jquery button selector


  Translation results:

button

UK[ˈbʌtn] US[ˈbʌtn]

n.Button, electric button; button, button; button-like object; [plant] bud

vt. To fasten with buttons; to decorate with buttons; to put buttons on; to attach buttons to…

vi. To fasten; to attach buttons; to button up

jquery button selectorsyntax

Function::The button selector selects <button> elements and <input> elements of type button.

Syntax: $(":button"

Comments: Using input:button through this selector will not select< button> element.

jquery button selectorexample

<html>
<head>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript"> 
 
$(document).ready(function(){
    $(":button").css("background-color","#B2E0FF");
});
 
</script>	
 
</head>
<body>
<html>
<body>
<form action="">
Name: <input type="text" name="user" />
<br />
Password: <input type="password" name="password" />
<br />
<button type="button">Useless Button</button>
<input type="button" value="Another useless button" />
<br />
<input type="reset" value="Reset" />
<input type="submit" value="Submit" />
<br />
</form>
 
</body>
</html>
</body>
</html>
Run instance »

Click the "Run instance" button to view the online instance

Popular Recommendations

Home

Videos

Q&A