I like to select an element by more than two condition.
for example
name is some name and checked
how can I do this?
I like to select an element by more than two condition.
for example
name is some name and checked
how can I do this?
You can append the attribute and :checked selectors, like this:
$("[name=myName]:checked")
Th key here, don't leave a space and you're telling Sizzle (jQuery's selector engine) to filter on the same element. If you put a space between, it's would be: "find checked children of elements with this name."
You can do like this:
if ($('input[name="some_name"]').is(':checked'))
{
// your code here...........
}
This makes sure that it checks only for form input which is exactly what you are looking for.
jQuery uses CSS Selector rules for document matchings. if you know how to use CSS Selectors you will know how to do this use this as reference http://api.jquery.com/category/selectors/
and read more about CSS Selectors