Js this function calls without having to recapture the id name or tag name

  • 2020-03-30 02:10:23
  • OfStack

This is the node that you currently want to execute js to capture, so you can capture the id, name, or tag name in js without using document.getelement. It's usually obj.
<input type="button" id="tianjia" value=" bao   save " class="btn1" onClick="nullCheck(this)"/> 
function nullCheck(obj) 
......//Here write the code for the functionality you need

<input type="checkbox" name='agentType' id="exclusiveAgenter" value="exclusive" onchange="clickAgenter(this)"> 

function clickAgenter(obj){ 
$("[name='agentType']").removeAttr("checked");//To cancel all

Related articles: