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

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -