0

I've followed the jquery ui demos and checked previous question on SO, but cant see why my code isnt working. Im trying to use the jquery ui button to layout button. In this simple example I just want to erase the button label:

<!DOCTYPE HTML>  

<html>  

<head>  
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>  
<script type="text/javascript" src="jquery-ui.js"></script>  
</head>  

<body>  
<button type="button" id="b111">a</button>  
<script type="text/javascript">  
$(document).ready(function(){  
    $("#b111").button( {  
        text: false 
    } );  
});  
</script>  
</body>  

</html>  

2 Answers 2

2

From the jQuery UI documentation:

When set to false no text will be displayed, but the icons option must be enabled, otherwise the text option will be ignored.

So you can only say text: false if you have set an icon to display:

$("#b111").button( 
    { text: false, icons: { primary: "ui-icon-locked" } });
Sign up to request clarification or add additional context in comments.

Comments

0

For you to use the 'text' boolean, you need to be using the icons option:

http://api.jqueryui.com/button/#option-icons

Seems like a weird thing to do though.

You can remove the 'a' from the HTML itself, and the button will have no text. However, if you wish to keep the size, but simply hide the text, then just do it in CSS:

#b111 * {
    visibility:hidden;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.