Javascript jquery: Difference between revisions
From wikinotes
No edit summary |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 11: | Line 11: | ||
|} | |} | ||
</blockquote><!-- Documentation --> | </blockquote><!-- Documentation --> | ||
= Tutorials = | |||
<blockquote> | |||
{| class="wikitable" | |||
|- | |||
| w3schools tut || https://www.w3schools.com/jquery/default.asp | |||
|- | |||
|} | |||
</blockquote><!-- Tutorials --> | |||
= Example = | |||
<blockquote> | |||
<syntaxhighlight lang="javascript"> | |||
function hospitalAndAddr() { | |||
var hospital = $(this).children("h3")[0].innerText; | |||
var addr = $(this).children("p")[0].innerText; | |||
return `${hospital}\n${addr}`; | |||
} | |||
var hospitals = $("article.hospitals").map(hospitalAndAddr); | |||
for (const h of hospitals) { | |||
console.log(h); | |||
} | |||
</syntaxhighlight> | |||
</blockquote><!-- Example --> | |||
= Notes = | |||
<blockquote> | |||
{| | |||
|- | |||
| [[jquery datatypes]] | |||
|- | |||
| [[jquery selectors]] | |||
|- | |||
| [[jquery events]] | |||
|- | |||
| [[jquery elements]] | |||
|- | |||
|} | |||
</blockquote><!-- Notes --> |
Latest revision as of 19:53, 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 hospitalAndAddr() { var hospital = $(this).children("h3")[0].innerText; var addr = $(this).children("p")[0].innerText; return `${hospital}\n${addr}`; } var hospitals = $("article.hospitals").map(hospitalAndAddr); for (const h of hospitals) { console.log(h); }
Notes
jquery datatypes jquery selectors jquery events jquery elements