开发者

jQuery: trying to get the input value

开发者 https://www.devze.com 2023-01-17 06:21 出处:网络
i\'m trying to obtain an input va开发者_StackOverflow社区lue with this: var $a = (\'#telephone_number\').val();

i'm trying to obtain an input va开发者_StackOverflow社区lue with this:

var $a = ('#telephone_number').val();

alert($a);

But nothing, any idea?

telephone_number is the id of the input.

Regards

Javi


use this

var $a = jQuery('#telephone_number').val();

OR

var $a = $('#telephone_number').val();


   var $a = $('#telephone_number').val();

    alert($a);

currently you are not passing the div id to jQuery, u are just doing (#tel_no) this is wrong.

0

精彩评论

暂无评论...
验证码 换一张
取 消