<?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: Ali Taha Shakir</title>
    <description>The latest articles on DEV Community by Ali Taha Shakir (@alitahashakir).</description>
    <link>https://dev.to/alitahashakir</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%2F468740%2F7669a7c8-104f-4446-ac38-5f35f3e37845.jpg</url>
      <title>DEV Community: Ali Taha Shakir</title>
      <link>https://dev.to/alitahashakir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alitahashakir"/>
    <language>en</language>
    <item>
      <title>Get started with Web Development, HTML Part-1</title>
      <dc:creator>Ali Taha Shakir</dc:creator>
      <pubDate>Fri, 02 Apr 2021 12:54:04 +0000</pubDate>
      <link>https://dev.to/alitahashakir/get-started-with-web-development-html-part-1-3l3b</link>
      <guid>https://dev.to/alitahashakir/get-started-with-web-development-html-part-1-3l3b</guid>
      <description>&lt;p&gt;Hello everyone. The aim of this article is to provide basic HTML knowledge and get you familiar with common tags and statements which you need to get started with your first HTML page.&lt;/p&gt;

&lt;h2&gt;
  
  
  DOCTYPE
&lt;/h2&gt;

&lt;p&gt;Document type declaration also known as &lt;code&gt;DOCTYPE&lt;/code&gt; informs the browser about markup language in which the current page is written in. &lt;/p&gt;

&lt;p&gt;It is the first line in every HTML page and is written as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  html
&lt;/h2&gt;

&lt;p&gt;Truth be told, I don’t know exactly why the &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag is used. But I know it is a common practice to use it as a wrapper for all your other tags except &lt;code&gt;DOCTYPE&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You should also include &lt;code&gt;lang&lt;/code&gt; attribute in your &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag to declare language of web page and to assist search engines and browsers&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  head
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; section contains the information about the page which is readable by browsers, search engines, and other sites.&lt;/p&gt;

&lt;p&gt;Some common things which are included in &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Meta tags (useful to search engines)&lt;/li&gt;
&lt;li&gt;Title tag (page title, shows up in your browser tab)&lt;/li&gt;
&lt;li&gt;Link tag (use to link your CSS files in HTML page)&lt;/li&gt;
&lt;li&gt;Script tag (use to link you JavaScript file in you HTML page)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:title"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Example page title."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:description"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Example page description."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:image"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"url to your image"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Page title&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  body
&lt;/h2&gt;

&lt;p&gt;Everything which is visible on your page comes inside the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag. Most of the tags which we will go through are used in &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:title"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Example page title."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:description"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"Example page description."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:image"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"url to your image"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

        &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Page title&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
        &lt;span class="c"&gt;&amp;lt;!-- page content comes here --&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;We went through basic HTML tags which occur on almost all HTML pages and made a skeleton boilerplate for our HTML file. In the next article of this series we will go through the tags which are used in &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag and are used to layout your page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thanks for Reading.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you enjoyed this post please share, and follow me on &lt;a href="https://dev.to/alitahashakir"&gt;DEV.to&lt;/a&gt; or &lt;a href="https://twitter.com/AliTahaShakir"&gt;Twitter&lt;/a&gt; if you would like to know as soon as I publish a post! 🔥&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>html</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Should developers write blogs?</title>
      <dc:creator>Ali Taha Shakir</dc:creator>
      <pubDate>Fri, 26 Mar 2021 13:18:04 +0000</pubDate>
      <link>https://dev.to/alitahashakir/should-developers-write-blogs-4oph</link>
      <guid>https://dev.to/alitahashakir/should-developers-write-blogs-4oph</guid>
      <description>&lt;p&gt;This post is a humble suggestion rather than a discussion on why you should start to write a blog as soon as possible?&lt;/p&gt;

&lt;p&gt;Writing a blog is not a one day job, it is a commitment that you keep working on. &lt;/p&gt;

&lt;p&gt;When I made the decision to start blogging, among other things my primary inclination was to give back to the awesome community which has given me so much. I am here, because many people knowing or unknowingly have helped me, and I am hoping that I and my content can help others in the same manner.&lt;/p&gt;

&lt;p&gt;Furthermore, writing is unavoidable, as a developer I have to produce some type of content in written form regularly. It could be a brief for a project, product release notes, or a simple git commit messages. Since easy to understand and concise technical writing takes practice, it made sense to make proactive effort to practice it. Writing a blog is a perfect opportunity to get some practice.&lt;/p&gt;

&lt;p&gt;There are many reasons for how blogging is helpful . In no particular order here are a few:&lt;/p&gt;

&lt;h2&gt;
  
  
  Blogs become my online notes
&lt;/h2&gt;

&lt;p&gt;I started my career as designer then transitioned into development. As I started to learn JavaScript I realized that my brain was not wired as a developer and it was hard for me to process and retain information and concepts that I have learned.&lt;/p&gt;

&lt;p&gt;Writing a blog post about a particular topic made me learn about it more extensively than just watching a tutorial, and everything that I have learned, I have noted it in my blog post which I can refer to whenever I need a refresher on that topic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Giving back to community
&lt;/h2&gt;

&lt;p&gt;While learning, I found the most useful resource usually were the articles written by other developers who worked through the steps on how to use something. While technology is always changing and evolving, if you have something to share, then share it even if you think it's obscure or might not be useful, there's always someone else who is working on something similar.&lt;/p&gt;

&lt;p&gt;Even if you are a new developer with little experience, write what you have learned from your experience, perhaps it's useful to another developer with less (or even more) experience following their own skills development path. &lt;/p&gt;

&lt;h2&gt;
  
  
  It looks professional and validates your knowledge
&lt;/h2&gt;

&lt;p&gt;In tech world, developer of any experience or education can fall prey to developer impostor syndrome, despite external evidence proving otherwise. Writing blogs about what you know is an easy way to bring your knowledge to everyone. It validates your knowledge to you and others.&lt;/p&gt;

&lt;p&gt;The topics you choose to write about, make it easy for potential employers and clients to appraise you. They can better determine the depth of knowledge you have, and how you can be helpful to them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Above, I have stated a few reasons on why you should start blogging. I am sure other people have their own interesting reason on why you started blogging and I would love to hear them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thanks for Reading.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you enjoyed this post please share, and follow me on &lt;a href="https://dev.to/alitahashakir"&gt;DEV.to&lt;/a&gt; or &lt;a href="https://twitter.com/AliTahaShakir"&gt;Twitter&lt;/a&gt; if you would like to know as soon as I publish a post! 🔥&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>writing</category>
      <category>career</category>
      <category>healthydebate</category>
    </item>
    <item>
      <title>map() Array Method</title>
      <dc:creator>Ali Taha Shakir</dc:creator>
      <pubDate>Mon, 22 Feb 2021 16:00:33 +0000</pubDate>
      <link>https://dev.to/alitahashakir/map-array-method-ii9</link>
      <guid>https://dev.to/alitahashakir/map-array-method-ii9</guid>
      <description>&lt;p&gt;Lets take a look at JavaScript  &lt;code&gt;map()&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;The map() method executes a callback function for each element of array. That callback function accepts between one and three arguments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Current Value (required) - The value of the current array element being processed in loop.&lt;/li&gt;
&lt;li&gt;Index (optional) - The current element's index number.&lt;/li&gt;
&lt;li&gt;Array (optional) - The array &lt;code&gt;map()&lt;/code&gt; was called upon.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That sounds a lot like &lt;a href="https://dev.to/alitahashakir/foreach-array-method-1d71"&gt;forEach() method&lt;/a&gt;. But where forEach() method is allowed to mutate the original array and will always return &lt;code&gt;undefined&lt;/code&gt;, map() method will always utilize the return values and actually returns a new Array of the same size.&lt;/p&gt;

&lt;p&gt;Considering that we have the following array below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbersArray = [1, 2, 3, 4, 5];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s apply foreach() method on above array.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: that you would never &lt;code&gt;return&lt;/code&gt; from a &lt;code&gt;forEach()&lt;/code&gt; method as the &lt;code&gt;return&lt;/code&gt; values are simply discarded:&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;numbersArray.forEach((number, index) =&amp;gt; {
    return numbersArray[index] = number * 2;
});
console.log(numbersArray);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;result will be:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;numbersArray = [2, 4, 6, 8, 10]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now here’s an example with map() method:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbersTimesTwo = numbersArray.map(number =&amp;gt; {
    return number * 2
})
console.log(numbersTimesTwo)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;result will be:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;numbersTimesTwo = [2, 4, 6, 8, 10]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Let’s look at another example: say you received an array which contains multiple objects – each one representing a student. The thing you really need in the end, though, is an array containing only the id of each student.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// What you have
let students = [
  { id: 12, name: 'Chadwick Boseman' },
  { id: 18, name: 'Chris Hemsworth' },
  { id: 27, name: 'Chris Evans' },
  { id: 56, name: 'Scarlett Johansson' }
];

// What you need
[12, 18, 27, 56]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;There are multiple ways to achieve this. You might want to do it by creating an empty array, then using &lt;code&gt;forEach()&lt;/code&gt; method to push the id in an empty array&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let studentsIds = [];
students.forEach(function(student) {
  studentsIds.push(student.id);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;OR we can make this simpler and use map() method&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let studentsIds = students.map(function(student) {
  return student.id
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Alternatively, you can use the ES6 arrow function representation for simplifying the code:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const studentsIds = students.map(student =&amp;gt; student.id);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you enjoyed this post please share, and follow me on &lt;a href="https://dev.to/alitahashakir"&gt;DEV.to&lt;/a&gt; or &lt;a href="https://twitter.com/AliTahaShakir"&gt;Twitter&lt;/a&gt; if you would like to know as soon as I publish a post! 🔥&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>arrays</category>
    </item>
    <item>
      <title>forEach() Array Method</title>
      <dc:creator>Ali Taha Shakir</dc:creator>
      <pubDate>Mon, 15 Feb 2021 15:44:26 +0000</pubDate>
      <link>https://dev.to/alitahashakir/foreach-array-method-1d71</link>
      <guid>https://dev.to/alitahashakir/foreach-array-method-1d71</guid>
      <description>&lt;p&gt;JavaScript provide us with several built in functions to work with arrays which are know as Array Methods. Lets take a closer look at JavaScript  forEach() method.&lt;/p&gt;

&lt;p&gt;The forEach() method executes a callback function for each element of array. That callback function accepts between one and three arguments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Current Value (required) – The value of the current array element being processed in loop&lt;/li&gt;
&lt;li&gt;Index (optional) – The current element’s index number&lt;/li&gt;
&lt;li&gt;Array (optional) – The array forEach() was called upon&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Considering that we have the following array below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbersArray = [1, 2, 3, 4, 5];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lets apply forEach() method to numbers array, you need a callback function (or anonymous function):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;numbersArray.forEach(function() {
    // code
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function will be executed on each element of the array. It requires the current value parameter which represents the element of an array which is currently being processed in loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;numbersArray.forEach(function(number) {
    console.log(number);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2VUZ0njB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/puaht7kosiosl1gzam5a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2VUZ0njB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/puaht7kosiosl1gzam5a.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the minimum required syntax to run forEach() method.&lt;/p&gt;

&lt;p&gt;Alternatively, you can use the ES6 arrow function representation for simplifying the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;numbersArray.forEach(number =&amp;gt; console.log(number));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you enjoyed this post please share, and follow me on &lt;a href="https://dev.to/alitahashakir"&gt;DEV.to&lt;/a&gt; or &lt;a href="https://twitter.com/AliTahaShakir"&gt;Twitter&lt;/a&gt; if you would like to know as soon as I publish a post! 🔥&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>loops</category>
      <category>array</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Select HTML elements using JavaScript</title>
      <dc:creator>Ali Taha Shakir</dc:creator>
      <pubDate>Mon, 08 Feb 2021 15:28:51 +0000</pubDate>
      <link>https://dev.to/alitahashakir/select-html-elements-using-javascript-1p1p</link>
      <guid>https://dev.to/alitahashakir/select-html-elements-using-javascript-1p1p</guid>
      <description>&lt;p&gt;If you want to make changes to the website or an app after it is loaded you need to do so by changing the elements inside the DOM. &lt;/p&gt;

&lt;p&gt;We will go through JavaScript methods which you can use to select elements in the DOM.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;document.getElementsByName()&lt;/code&gt;&lt;br&gt;
&lt;code&gt;document.getElementsByTagName()&lt;/code&gt;&lt;br&gt;
&lt;code&gt;document.getElementsByClassName()&lt;/code&gt;&lt;br&gt;
&lt;code&gt;document.querySelectorAll()&lt;/code&gt;&lt;br&gt;
&lt;code&gt;document.querySelector()&lt;/code&gt;&lt;br&gt;
&lt;code&gt;document.getElementById()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;document.getElementsByName()&lt;/code&gt; is not used that often but it is available. Basically what it does is that it selects all the element in DOM which is assigned a name property and you specify that name property inside those parenthesis.&lt;br&gt;
ref: &lt;a href="https://www.w3schools.com/JSREF/met_doc_getelementsbyname.asp"&gt;w3schools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;document.getElementsByTagName()&lt;/code&gt; is used to select elements by tag name, for example you can get a list of all the div’s on your HTML page using this selector.&lt;br&gt;
ref: &lt;a href="https://www.w3schools.com/JSREF/met_document_getelementsbytagname.asp"&gt;w3schools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;document.getElementsByClassName()&lt;/code&gt; is same as &lt;code&gt;.getElementsByTagName()&lt;/code&gt; but this time we target elements using class. You specify the  class name in parenthesis and it will get all those elements which have that class property assigned to them.&lt;br&gt;
ref: &lt;a href="https://www.w3schools.com/JSREF/met_document_getelementsbyclassname.asp"&gt;w3schools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;document.querySelectorAll()&lt;/code&gt; and &lt;code&gt;document.querySelector()&lt;/code&gt; allows you to target a specific ID, Class, or a Tag Name. The difference in .querySelectorAll() and .querySelector() is that .querySelectorAll() target all the elements in HTML which matches the ID, Class, or a Tag Name that you have specified in parenthesis. While .querySelector() only targets the first element that matches the ID, Class, or a Tag Name.&lt;br&gt;
ref: &lt;a href="https://www.w3schools.com/JSREF/met_document_queryselectorall.asp"&gt;w3schools&lt;/a&gt;&lt;br&gt;
ref: &lt;a href="https://www.w3schools.com/JSREF/met_document_queryselector.asp"&gt;w3schools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;document.getElementById()&lt;/code&gt; perhaps on of the most used command from all the selectors targets a specific ID which you have mentioned in the parenthesis.&lt;br&gt;
ref: &lt;a href="https://www.w3schools.com/JSREF/met_document_getelementbyid.asp"&gt;w3schools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
We went through total of six(6) JavaScript methods in which we have four(4) methods that returns one or more elements and two(2) methods that return single element.&lt;/p&gt;

&lt;p&gt;If you enjoyed this post please share, and follow me on &lt;a href="https://dev.to/alitahashakir"&gt;DEV.to&lt;/a&gt; or &lt;a href="https://twitter.com/AliTahaShakir"&gt;Twitter&lt;/a&gt; if you would like to know as soon as I publish a post! 🔥&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
