Home > Web Front-end > JS Tutorial > jquery common operation methods_jquery

jquery common operation methods_jquery

WBOY
Release: 2016-05-16 18:35:53
Original
918 people have browsed it

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)});

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template