728x90
SMALL
#jQuery
:button
: Button is a selector that selects the element whose type is button.
grammar
$( ':button' )
Selects all elements whose type is button.
$( '.xy:button' )
Select an element whose type is button and whose class value is xy.
example
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery</title>
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
$( document ).ready( function() {
$( ':button' ).css( 'font-style', 'italic' );
$( '.ab:button' ).css( 'color', 'red' );
} );
</script>
</head>
<body>
<input type="button" value="Button 1" class="ab">
<input type="button" value="Button 2" class="cd">
</body>
</html>
Italics the text of the element whose type is button, the class value is ab, and the text color of the element whose type is button is red.
728x90
LIST