Home  >  Article  >  Web Front-end  >  jquery common operation methods_jquery

jquery common operation methods_jquery

WBOY
WBOYOriginal
2016-05-16 18:35:53912browse

Operation drop-down list

Add option list

$(this).get(0).options.add(new Option(text,value));

Clear the list

$(this).get(0).options.length=0;

Remove the option at the specified index

$(this).get(0).remove( index);

Set the value of the item to be selected

$(this).get(0).value=value;

Get the text of the currently selected option

$(this).get(0).options[index].text;

Batch modify CSS

$(this).css({left:"35px", top:"24px"})

Make the elements in the specified area unusable (grayed out)

$(this).find(*).each(function(){$(this ).attr("disabled",true)});

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn