jquery - Why do we write .attr('selected','selected') with select tag -
why write .attr('selected','selected') select tag
for ex:
$('#countrylist option').filter(function () { return ($(this).text() == findtext); }).attr('selected','selected'); }); what means?
explanation of .attr('selected','selected').
first argument inside .attr represent attribute want pointing @ while second argument set value of attribute passed first argument.
if have .attr('selected') return value of selected attribute.
Comments
Post a Comment