how to define variable in jquery

后端 未结 8 1361
梦谈多话
梦谈多话 2021-01-31 09:09

I would like to know how to declare a variable in jQuery

The code I am currently using is

$.name = \'anirudha\';
alert($.name);

That co

8条回答
  •  误落风尘
    2021-01-31 09:27

    In jquery, u can delcare variable two styles.

    One is,

    $.name = 'anirudha';
    alert($.name);
    

    Second is,

    var hText = $("#head1").text();
    

    Second is used when you read data from textbox, label, etc.

提交回复
热议问题