简体   繁体   中英

get specific element inside an element with Mootools

I have a Mootools element which is a HTML LI element. Inside of it, (child of child), somewhere, there is an input element.

How can I find with Mootools, the input element inside of the li element and retrieve it ?

 var input = li. ...

You can use var input = li.getElement('input'); , that will return the first input it finds. .getElement is kind of the MooTools querySelector before it existed, so it takes a CSS selector.

You might want to use a more specific CSS selector if there are several inputs though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM