Javascript jquery: Difference between revisions
From wikinotes
(→Notes) |
No edit summary |
||
Line 20: | Line 20: | ||
|} | |} | ||
</blockquote><!-- Tutorials --> | </blockquote><!-- Tutorials --> | ||
= Example = | |||
<blockquote> | |||
<syntaxhighlight lang="javascript"> | |||
function friendAndAddr() { | |||
var friend = $(this).children("h3")[0].innerText; | |||
var addr = $(this).children("p")[0].innerText; | |||
return `${friend}\n${addr}`;` | |||
} | |||
var friendsWithAddr = $("article.friends").map(friendAndAddr); | |||
console.log(friendsWithAddr); | |||
</syntaxhighlight> | |||
</blockquote><!-- Example --> | |||
= Notes = | = Notes = |
Revision as of 19:49, 4 February 2023
Abstracts HTML DOM, CSS, events, AJAX.
Documentation
official docs https://api.jquery.com/ home https://jquery.com/
Tutorials
w3schools tut https://www.w3schools.com/jquery/default.asp
Example
function friendAndAddr() { var friend = $(this).children("h3")[0].innerText; var addr = $(this).children("p")[0].innerText; return `${friend}\n${addr}`;` } var friendsWithAddr = $("article.friends").map(friendAndAddr); console.log(friendsWithAddr);
Notes
jquery datatypes jquery selectors jquery events jquery elements