<?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>Forem: Mohammed Mouzzam</title>
    <description>The latest articles on Forem by Mohammed Mouzzam (@danish0929x).</description>
    <link>https://forem.com/danish0929x</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%2F890060%2Fcee4a3c2-9e95-46df-a71a-53ccdc99dd7b.jpg</url>
      <title>Forem: Mohammed Mouzzam</title>
      <link>https://forem.com/danish0929x</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/danish0929x"/>
    <language>en</language>
    <item>
      <title>Javascript counter | HTML, CSS, JS</title>
      <dc:creator>Mohammed Mouzzam</dc:creator>
      <pubDate>Sun, 21 Aug 2022 06:50:18 +0000</pubDate>
      <link>https://forem.com/danish0929x/javascript-counter-html-css-js-18eg</link>
      <guid>https://forem.com/danish0929x/javascript-counter-html-css-js-18eg</guid>
      <description>&lt;p&gt;A simple javascript counter using HTML, CSS and &lt;strong&gt;Javascript&lt;/strong&gt;&lt;br&gt;
Stay tuned for more tutorials like this.&lt;/p&gt;

&lt;p&gt;Video Tutorial and source code is given below &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/HTBF20kb4bU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;index.html&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;Simple counter using HTML, CSS, JS&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"&amp;gt;
    &amp;lt;link rel="stylesheet" href="style.css"&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;


    &amp;lt;div class="whole"&amp;gt;
        &amp;lt;div class="main"&amp;gt;
            &amp;lt;div class="counter"&amp;gt;9&amp;lt;/div&amp;gt;
            &amp;lt;div class="plus count"&amp;gt;&amp;lt;i class="fa-solid fa-plus"&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;div class="minus count"&amp;gt;&amp;lt;i class="fa-solid fa-minus"&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div class="reset"&amp;gt;
            &amp;lt;button class="reset-btn"&amp;gt;Reset&amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;



&amp;lt;script src="app.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a file in same directory and name it style.css&lt;br&gt;
paste the code given below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,700&amp;amp;display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    font-family: 'Roboto', sans-serif;

}

.whole{
    margin: auto;
}


.main{
    width: 300px;
    position: relative;
}

.main .counter{
    width: 200px;
    height: 200px;
    margin: auto;
    display: flex;
    text-align: center;
    justify-content: center;
    align-items: center;
    background-color: #FF5757;
    border-radius: 5px;
    font-size: 5rem;
    font-weight: 700;
    color: #fff;
}


.count{
    position: absolute;
    width: 80px;
    height: 80px;
    background-color: #fff;
    border: 5px solid #FF5757;
    display: flex;
    align-items: center;
    justify-content: center;
    bottom: -30px;
    border-radius: 5px;
}


.count i{
    color: #FF5757;
    font-size: 2rem;
}


.count:hover{
    box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;

}

.plus{
    right: 10px;
}
.minus{
    left: 10px;
}

.reset{
    align-items: center;
    text-align: center;
    margin-top: 80px;


}

.reset .reset-btn{
    margin: auto;
    outline: none;
    padding: 10px 18px;
    background-color: #fff;
    border-radius: 5px;
    border: 5px solid #FF5757;
    color: #FF5757;
    font-size: 1.2rem;
    font-weight: 700;

}

.reset .reset-btn:hover{
    background-color: #FF5757;
    color: #fff;

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

&lt;/div&gt;



&lt;p&gt;And finally a Javascript file name it as app.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const counter = document.querySelector('.counter');
const add = document.querySelector('.plus')
const sub = document.querySelector('.minus')
const resetNum = document.querySelector('.reset-btn')

let number = counter.innerHTML;

add.addEventListener('click', function(){
    number++;  
    addToHtml(number);
})

sub.addEventListener('click', function(){
    number--;  
    addToHtml(number);
})

resetNum.addEventListener('click', function(){ 
    addToHtml(0);
})


function addToHtml(value){
    number = value;
    counter.innerHTML = value;
}

addToHtml(0)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Thanks for reading&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If any suggestions please let me know&lt;br&gt;
I am happy to talk with you&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>css</category>
    </item>
    <item>
      <title>Input design with label using HTML and CSS</title>
      <dc:creator>Mohammed Mouzzam</dc:creator>
      <pubDate>Wed, 17 Aug 2022 20:38:00 +0000</pubDate>
      <link>https://forem.com/danish0929x/input-design-with-label-using-html-and-css-bp0</link>
      <guid>https://forem.com/danish0929x/input-design-with-label-using-html-and-css-bp0</guid>
      <description>&lt;p&gt;Check out the tutorial in YouTube &lt;br&gt;
&lt;a href="https://youtu.be/odtqmbJqV9w"&gt;https://youtu.be/odtqmbJqV9w&lt;/a&gt;&lt;br&gt;
and upgrade your frontend skils, like and share if it is useful and don't forget to &lt;strong&gt;subscribe&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Stay tuned for latest frontend and javascript tutorials &lt;/p&gt;

&lt;h1&gt;
  
  
  haveagoodday
&lt;/h1&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
