Small Wolf
Small Wolf

Reputation: 283

the selector in JavaScript

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("conv..."); what should i do in here? Thank you, and best regards!

Upvotes: 1

Views: 74

Answers (3)

unomi
unomi

Reputation: 2672

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

Upvotes: 1

Peter Jaric
Peter Jaric

Reputation: 5302

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).

Upvotes: 3

Dan Heberden
Dan Heberden

Reputation: 11068

$('#conversation_sub_kind_id_208'); 

more here

Upvotes: 5

Related Questions