<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: rileydaviskatz</title>
    <description>The latest articles on DEV Community by rileydaviskatz (@rileydaviskatz).</description>
    <link>https://dev.to/rileydaviskatz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F743325%2F3e5118d9-988c-4373-ac08-6f947793a93a.jpeg</url>
      <title>DEV Community: rileydaviskatz</title>
      <link>https://dev.to/rileydaviskatz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rileydaviskatz"/>
    <language>en</language>
    <item>
      <title>jQuery and You: Learning the Basics</title>
      <dc:creator>rileydaviskatz</dc:creator>
      <pubDate>Tue, 02 Nov 2021 17:19:35 +0000</pubDate>
      <link>https://dev.to/rileydaviskatz/jquery-and-you-learning-the-basics-24mc</link>
      <guid>https://dev.to/rileydaviskatz/jquery-and-you-learning-the-basics-24mc</guid>
      <description>&lt;p&gt;jQuery is a powerful tool that lets you add functionality to what would otherwise be hard-coded HTML scripts by injecting javascript into it.&lt;/p&gt;

&lt;p&gt;This works by "wrapping" HTML code in dynamic Javascript that can be manipulated.&lt;/p&gt;

&lt;p&gt;The power of $:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I hope you appreciate the pun I just made.&lt;/li&gt;
&lt;li&gt;The hidden abilities of jQuery are unlocked with the $ and paired with (). Once you create the $('') you can start to inject the HTML code within it. For instance:
$('&amp;lt; h1&amp;gt;Hello World!')  {&amp;lt; space added before h1 so format would display correctly when live}will create a header in the HTML document that says "Hello World!"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Adding content to tags with jQuery:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;While we can declare tags easily with jQuery, there are steps we can use to add content to tags later on.
Example:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;//declare an empty set of tags&lt;br&gt;
let $empty = $('&lt;/p&gt;
&lt;h6&gt;&lt;/h6&gt;');&lt;br&gt;
//add content&lt;br&gt;
$empty.text('This headline is no longer empty!');

&lt;ol&gt;
&lt;li&gt;We can also manipulate and add content to entire types of HTML code by using .html(). This method tells the interpreter to apply changes to all tags of the same type&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;$('ul').html('Placeholder Text');&lt;/p&gt;

&lt;p&gt;This example takes all instances of unordered lists and applies the "Placeholder Text" content to all instances instead of just one.&lt;/p&gt;

&lt;p&gt;Methods for combining tags:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Since jQuery is similar to Javascript, it comes with methods we can use to manipulate the code we are writing. For instance, we can create a body tag, and then later on, add code to the body by using appendTo or prepend.
Example:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;let $body = $('&lt;/p&gt;');

&lt;p&gt;let $paragraph = $('&lt;/p&gt;
&lt;p&gt;This is an example of how we can write a line of jQuery code and add it to another tag&lt;/p&gt;')

&lt;p&gt;$paragraph.appendTo($body);&lt;br&gt;
This makes the browser interpret the HTML as &lt;/p&gt;
&lt;p&gt;This is an example of how we can write a line of jQuery code and add it to another tag&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Also like Javascript, we can chain together different methods. So if we wanted to add a class to the paragraph while we appended it to the body, we could do this:
$paragraph.appendTo($body).addClass('examples');&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Conclusion:&lt;/p&gt;

&lt;p&gt;jQuery is a powerful tool that takes HTML up a notch and makes, what would normally be hardcoded, dynamic and adjustable and lively. It's worth learning to make your websites less static.&lt;/p&gt;

</description>
      <category>jquery</category>
      <category>javascript</category>
      <category>html</category>
    </item>
  </channel>
</rss>
