Home  >  Article  >  Web Front-end  >  js this function call does not need to capture the id, name or tag name again_javascript tips

js this function call does not need to capture the id, name or tag name again_javascript tips

WBOY
WBOYOriginal
2016-05-16 16:57:291155browse

This is the node captured by the js you are currently executing. In this way, you can capture the id, name or tag name in js without writing methods such as document.getElement, saving some trouble. Usually obj is used instead.

Copy code The code is as follows:


<script> <br>function nullCheck(obj) <br>{ <br>...... //Write the code for the function you need here <br>} <br></script>



function clickAgenter(obj){
if($(obj).attr("checked")=="checked"){
$ ("[name='agentType']").removeAttr("checked");//Cancel all selections
$(obj).attr("checked","checked")
}
}
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