js中的with用法

    技术2022-05-12  17

    js:

    function fnShow() {  with(document.getElementById("txtA"))  {   alert(value);  } }

    html:

      <input type="text" id="txtA" name="txtA" value="aaaa">  <input type="button" value="btnA" οnclick="fnShow()">


    最新回复(0)