JQuery - Call the jquery button click event based on name property

后端 未结 4 2149
天涯浪人
天涯浪人 2021-02-13 09:46

I have one HTML button like,


         


        
4条回答
  •  青春惊慌失措
    2021-02-13 10:29

    You can use the name property for that particular element. For example to set a border of 2px around an input element with name xyz, you can use;

    $(function() {
        $("input[name = 'xyz']").css("border","2px solid red");
    })
    

    DEMO

提交回复
热议问题