jquery attribute$=value selector


  Translation results:

attribute

UK[əˈtrɪbju:t] US[əˈtrɪbjut]

vt. Think that... is; attribute... to; attribute the quality of... to someone; think that... Something [thing] belongs to someone [thing]

n. Attribute; (of a person or thing) characteristics; value; [grammar] Attributive

value

UK[ˈvælju:] 美[ˈvælju]

n. Value, price; meaning, connotation; importance; face value (of a stamp)

vt. Evaluation; attention, Value; value, price...

jquery attribute$=value selectorsyntax

Function: [attribute$=value] The selector selects each element with the specified attribute and ending with the specified string.

Syntax: $("[attribute$=string]"

Parameters: attribute Required. Specifies the attribute to be found. string Required. Specifies the string that the attribute value ends with.

jquery attribute$=value selectorexample

<html>
<head>
<script type="text/javascript" src="//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript"> 
 
$(document).ready(function(){
    $("[id$=header]").css("background-color","#B2E0FF");
});
</script>	
</head>
<body>
<html>
<body>
<h1 id="main_header">Welcome to My Homepage</h1>
<p class="intro">My name is Donald</p>
<p>I live in Duckburg</p>
<p>My best friend is Mickey</p>
<h3 id="sub_header">My uncle is Scrooge</h3>
<div id="choose">
Who is your favourite:
<ul>
<li>Goofy</li>
<li>Mickey</li>
<li>Pluto</li>
</ul>
</div>
</body>
</html>
</body>
</html>
Run instance »

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

Popular Recommendations

Home

Videos

Q&A