You're listening to this, and thinking, I'm not going to refactor all my code. That's not what I'm saying. At first, just go native when you need the performance, like in loops.
Here are a few examples of when jQuery actually makes the code more verbose than it would otherwise be because of the almighty $
.
myNode.id
vs$(this).attr('id')
. yes, always.myNode.value
vs$(this).val()
selectNode.selectedIndex
on a<select>
to get the selected indexselectNode.options
on a<select>
to get a list of optionstableNode.rows
on a<table>
to get a collection of<tr>
elementstrNode.cells
on a<tr>
to get a collection of cellsmyEl.parentNode
to get a direct parentmyInput.checked
vs$(this).is(':checked')
to get the state of acheckbox
myRadio.selected
to get the state of anoption
myInput.disabled
to read the state of aninput
orbutton
myInput.readOnly
to get the readOnly state of aninput
anchorOrLinkNode.href
on an<a>, <link>
to get itshref
myAnchorNode.hostname
on an<a>
to get the domain of itshref
myAnchorNode.pathname
on an<a>
to get the path of itshref
myAnchorNode.search
on an<a>
to get the querystring of itshref
myNode.src
on any element where you can set asrc