Pass object to javascript function

前端 未结 4 406
独厮守ぢ
独厮守ぢ 2020-12-08 02:22

I have recently been messing around with jQuery on my website, and I have a fairly limited knowledge of Javascript. I am beginning to like the jQuery ability to pass variabl

4条回答
  •  囚心锁ツ
    2020-12-08 02:28

    function myFunction(arg) {
        alert(arg.var1 + ' ' + arg.var2 + ' ' + arg.var3);
    }
    
    myFunction ({ var1: "Option 1", var2: "Option 2", var3: "Option 3" });
    

提交回复
热议问题