What does it mean to write like this?
王龙
王龙 2018-10-15 21:40:56
0
1
1481

<input type="text" id="a">

<input type="button" value=" " id="btn">

<script>

(function(window){

var input = document.querySelector('#a');

var btn=document.querySelector('#btn');

btn.addEventListener('click',function(){

var v=input.value;

v = v - 0;

v = v * 2;

input.value = v;

});

})(window);

这样写什么意思。

王龙
王龙

先学汇编 在学编程。

reply all(1)
王龙

(function(window){..})(window);  This is to execute an anonymous function parameter window. How does JS understand such syntax.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template