zettelkasten/OneNoteExport/Technik/Programieren/Javascript/04_jquery.md
Ralf Koop 7389e600f9 vault backup: 2023-11-12 11:19:55
Affected files:
2023-11-12 11:19:55 +01:00

1.1 KiB

jquery

Samstag, 21. Dezember 2019

19:15

 

$("#logo-events")

 

 

• $ - This is a shorthand symbol for invoking jQuery. All jQuery commands will start with this symbol. You can think of it as asking jQuery to go do something for you. In this case, we are saying, "jQuery go find the element with this ID." The $ is always followed by (), which enclose the element that you are looking for.

 

• # - This is a shorthand symbol for telling jQuery that you are looking for something by its ID. Any text following the # should be a valid ID on an HTML element and will only return one item, because HTML elements cannot share IDs.

 

• . - The period is shorthand for telling jQuery that you are looking for something by its CSS class. So if you have 10 DIVs in your HTML that all share the same CSS class of "red-box", you could find them all by using the following command: $(".redbox"). It has the exact same structure as an ID command, just with a . instead of a $. The . is always followed by (), which enclose the element that you are looking for.

#nochzubearbeiten