Reputation: 39
I don't understand one tag in cript after:
if (!$.browser.opera) {
// select element styling
$('select.select').each(function(){
var title = $(this).attr('title');
if( $('option:selected', this).val() != '' ) title = $('option:selected',this).text();
$(this)
.css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})
.after('<span class="select">' + title + '</span>')
.live('change', function(){
val = $('option:selected',this).text();
$(this).next().text(val);
});
$(this).nextAll().remove();
});
};
Tag "select.select" in above script. I bold it; What it mean? Thanks!
Upvotes: 1
Views: 60
Reputation: 4718
$('select.select').each()
is assuming that there are multiple <select>
tags with a class named select
like this:
<SELECT class="select" title="select1" >
....
</SLECT>
<SELECT class="select" title="select2" >
....
</SLECT>
<SELECT class="select" title="select3" >
....
</SLECT>
Hope this helps.
Upvotes: 0
Reputation: 74738
This selector:
$('select.select')
says:
get the select element which have the class name .select
.
.
is class notation in jQuery.
#
is id notation in jQuery.
Upvotes: 0
Reputation: 2495
This mean select
tags with select
class
<select class="select"></select>
Upvotes: 3
Reputation: 156978
The code wasn't readable from your question, but the source said
select.select
This is a jQuery selector selecting ALL the select
elements with class name select
.
The .each
behind it executes the action specified after it on every occurrence within the results.
Upvotes: 0
Reputation: 11116
$('select.select')
means that select all the select elements on the page with the class name "select"
Upvotes: 1
Reputation: 15860
$('select.select').each(function() { // ** was added for bolding purpose
If that is the code, then it means the select
element with the class name `select.
This jQuery code would select the select Element from the Document which has select className too. Then it would execute the code specified in the function ()
call.
Something like this
<select class="select">
<!-- options here -->
</select>
The above is the example sample for the select element that would be selected.
Upvotes: 2