开发者

the selector in JavaScript

开发者 https://www.devze.com 2023-01-03 07:11 出处:网络
I want to get the object of this code , <input class=\"radio\" id=\"conversation_sub_kind_id_208\" name=\"conversation[sub_kind_id]\"

I want to get the object of this code ,

<input class="radio" 
       id="conversation_sub_kind_id_208"
       name="conversation[sub_kind_id]"
       onclick="set_department_name('department_name208')"
       type="radio"
       value="208" />

I want to use jQuery Framework to get the object, like the document.getElementbyTagName("con开发者_运维百科v..."); what should i do in here? Thank you, and best regards!


$('#conversation_sub_kind_id_208'); 

more here


It should be as simple as $('#conversation_sub_kind_id_208'). That would give you the jQuery object. If you want the underlying DOM element, do it like this: $('#conversation_sub_kind_id_208').get(0).


Or you could not use Jquery and simply do: document.getElementById("conversation_sub_kind_id_208");

0

精彩评论

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