Tuesday, May 12, 2009

jquery starts with selector

"^=" is the operator for "starts with" in jquery. For example, the following finds all inputs whose names starts with "abc".

$("input:[name^='abc']")


Find all checked checkbox input with the css class name "non-draft=status"

$('input:checkbox.non-draft-status:checked')

Find all of td's children whose class is "data4Sort". Note children() only gives you the immediate children while find() goes deeper.

$('td').find('.data4Sort')

No comments:

Post a Comment