jquery submit selector


  Translation results:

submit

英[səbˈmɪt] 美[səbˈmɪt]

vi. Submit, obey; accept, endure

vt. To make obedient, To make obedient; to submit, to submit; [Law] to advocate, to suggest

jquery submit selectorsyntax

Function:: The submit selector selects <button> and <input> elements of type submit. If the <button> element has no defined type, most browsers will treat the element as a button of type submit.

Syntax: $(":submit")

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

jquery submit 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(){
    $(":submit").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 />
<button type="submit">Submit Button</button>
<br />
</form>
 
</body>
</html>
</body>
</html>
Run instance »

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

Home

Videos

Q&A