Load javascript file after button click

后端 未结 2 434
挽巷
挽巷 2021-01-14 05:56

I am trying to use a set of textboxes to define some data within my JavaScript file. So in a textbox I enter a Team name \"Team name\", and the javascript file uses this tex

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-14 06:25

    When you pass a function as the parameter to jQuery it will execute that function during document.ready(). It allows your page to load all of the scripts before executing them.

    $(function() {
        $('#buttontest').click(function() {
            $('div.bracket').show();
            $('div.teamList').hide();
        });
    
        $('#singleElim8').bracket({
            init: singleElim8Data
        })
      $('.bracket').hide();
    });
    

提交回复
热议问题