<?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: Elmouatez Billah Benariba</title>
    <description>The latest articles on Forem by Elmouatez Billah Benariba (@mouatezbenariba).</description>
    <link>https://forem.com/mouatezbenariba</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%2F851339%2Fa8e8c254-47f4-456f-b9ce-9fe2d877e060.png</url>
      <title>Forem: Elmouatez Billah Benariba</title>
      <link>https://forem.com/mouatezbenariba</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mouatezbenariba"/>
    <language>en</language>
    <item>
      <title>Create a simple Font Changer - Elzero Frontend Challenges</title>
      <dc:creator>Elmouatez Billah Benariba</dc:creator>
      <pubDate>Sun, 25 Jun 2023 09:00:54 +0000</pubDate>
      <link>https://forem.com/mouatezbenariba/create-a-simple-font-changer-elzero-frontend-challenges-mmi</link>
      <guid>https://forem.com/mouatezbenariba/create-a-simple-font-changer-elzero-frontend-challenges-mmi</guid>
      <description>&lt;h2&gt;
  
  
  Overview on Elzero Frontend Challenges
&lt;/h2&gt;

&lt;p&gt;Elzero Frontend Challenges is a collection of coding challenges designed for learners who want to improve their HTML and CSS skills. Created by &lt;a href="https://twitter.com/Osama_Elzero" rel="noopener noreferrer"&gt;Osama Mohamed (Elzero)&lt;/a&gt;, these challenges are available in the frontend track of &lt;a href="https://elzero.org/tracks/front-end/" rel="noopener noreferrer"&gt;Elzero Web School&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Challenge
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://elzero.org/frontend-font-changer/" rel="noopener noreferrer"&gt;Font Changer Challenge&lt;/a&gt; is a straightforward and easy task that involves the following objectives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating a Select Box containing a collection of Fonts for selection.&lt;/li&gt;
&lt;li&gt;When any Font is selected, it should be applied directly to the page as shown in the image.&lt;/li&gt;
&lt;li&gt;The task should be implemented in a dynamic manner, so that any Font added to the Select Box is automatically applied.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Building the Skelton
&lt;/h2&gt;

&lt;p&gt;The Font Changer consists of an input and an output component:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Input:&lt;/strong&gt; A select list containing three font options.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Output:&lt;/strong&gt; A text element where the font-family style will be applied.
&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="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container font-changer"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- input --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;select&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"fonts"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"text-fonts"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"font-changer__list"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Open Sans"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Open Sans&lt;span class="nt"&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Metal Mania"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Metal Mania&lt;span class="nt"&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"Caesar Dressing"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Caesar&lt;span class="nt"&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/select&amp;gt;&lt;/span&gt;
  &lt;span class="c"&gt;&amp;lt;!-- output --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"font-changer__result"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Testing Fonts Here&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To achieve this, I created a select list with three options, each representing a font's value and name. The output component is a div containing the text "Testing Fonts Here." These elements are encapsulated within a parent div. For consistent and clear class naming, the BEM (Block Element Modifier) methodology was followed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Perfecting the Styling
&lt;/h2&gt;

&lt;p&gt;To recreate the provided design, I applied styles to both the select list and the test text.&lt;/p&gt;

&lt;h2&gt;
  
  
  Font Changer Logic
&lt;/h2&gt;

&lt;p&gt;Each time the select list value changes, the font-family CSS property of the Test text gets the value of the selected font.&lt;/p&gt;

&lt;h2&gt;
  
  
  JavaScript Implementation
&lt;/h2&gt;

&lt;p&gt;First, I searched for the desired fonts on Google Fonts and included them using link tags.&lt;/p&gt;

&lt;p&gt;Second, I set the default font family for the test text as "Open Sans." This ensures that the text always has a font style applied.&lt;/p&gt;

&lt;p&gt;T﻿hird, I added an event listener to the select. Whenever a change occurs in the select element, the font family of the Test text is updated based on the selected value (Font Name)in the select element. The value attribute of each option in the select element corresponds to the font family declaration provided by Google Fonts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text-fonts&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.font-changer__result&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;font&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;change&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fontFamily&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Github: ﻿&lt;a href="https://github.com/mouatezbenariba/Elzero-Frontend-Challenges/tree/main/font-changer" rel="noopener noreferrer"&gt;Font Changer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Demo: ﻿&lt;a href="https://mouatezbenariba.github.io/Elzero-Frontend-Challenges/font-changer/" rel="noopener noreferrer"&gt;Font Changer&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Codepen: &lt;a href="https://codepen.io/mouatezbenariba/pen/JjeRVmB" rel="noopener noreferrer"&gt;Font Changer&lt;/a&gt;﻿﻿&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Give it a Try!
&lt;/h2&gt;

&lt;p&gt;I invite you to rate my work and give it a try yourself. Engaging in frontend challenges like this one can be an excellent opportunity to enhance your skills, expand your knowledge, and improve your problem-solving abilities.&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Build a button that shows and hides a paragraph - Elzero Frontend Challenges</title>
      <dc:creator>Elmouatez Billah Benariba</dc:creator>
      <pubDate>Mon, 29 May 2023 18:46:22 +0000</pubDate>
      <link>https://forem.com/mouatezbenariba/elzero-frontend-challenges-build-a-button-that-shows-and-hides-a-paragraph-4b2f</link>
      <guid>https://forem.com/mouatezbenariba/elzero-frontend-challenges-build-a-button-that-shows-and-hides-a-paragraph-4b2f</guid>
      <description>&lt;h2&gt;
  
  
  Overview on Elzero Frontend Challenges
&lt;/h2&gt;

&lt;p&gt;Elzero Frontend Challenges is a collection of coding challenges designed for learners who want to improve their HTML and CSS skills. Created by &lt;a href="https://twitter.com/Osama_Elzero" rel="noopener noreferrer"&gt;Osama Mohamed (Elzero)&lt;/a&gt;, these challenges are available in the frontend track of &lt;a href="https://elzero.org/tracks/front-end/" rel="noopener noreferrer"&gt;Elzero Web School&lt;/a&gt;. &lt;a href="https://mouatezbenariba.me/src/html/case-study/elzero-frontend-challenges.html" rel="noopener noreferrer"&gt;[1]&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;As part of my journey to enhance my frontend skills, I took on the &lt;a href="https://elzero.org/category/challenges/front-end-challenges/" rel="noopener noreferrer"&gt;Elzero Frontend Challenges&lt;/a&gt;. Initially, progress was slow, but I was determined to overcome the obstacles and improve my abilities. Upon my return to the challenges, I encountered some new additions that piqued my interest. In this blog post, I will share my experience and insights gained from tackling the "&lt;strong&gt;&lt;a href="https://elzero.org/frontend-show-hide-paragraph/" rel="noopener noreferrer"&gt;show/hide paragraph challenge&lt;/a&gt;&lt;/strong&gt;".&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Challenge
&lt;/h2&gt;

&lt;p&gt;The objective of this challenge was to create a button that toggles the visibility of a paragraph when clicked. While seemingly simple, it taught me an important lesson: "Understanding the question is half the answer."&lt;/p&gt;

&lt;h2&gt;
  
  
  Building the Foundation
&lt;/h2&gt;

&lt;p&gt;To begin, I created a basic HTML structure for the challenge. Following best practices, I adhered to the BEM (Block, Element, Modifier) naming convention, ensuring a clean and organized codebase. With the foundation in place, I proceeded to the next stage of styling the elements using CSS.&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="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container action"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"action__btn"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Click&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"action__content"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This is My Paragraph&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c5fv5g1uucfc1ba1maa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4c5fv5g1uucfc1ba1maa.png" alt="a flowchart of the used html structure" width="356" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Perfecting the Styling
&lt;/h2&gt;

&lt;p&gt;To achieve the desired design, I leveraged CSS to add the necessary visual enhancements.&lt;/p&gt;

&lt;p&gt;For the button, I removed the default border styling and added a hover effect that changed the mouse cursor to a hand. These subtle details contribute to a better user experience.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.action__btn&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* reset all inherited styles to their initial value */&lt;/span&gt;
  &lt;span class="nl"&gt;all&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;unset&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* add custom button style */&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.2rem&lt;/span&gt; &lt;span class="m"&gt;1.2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--cyan-100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;border-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--cyan-100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.4rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.4rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Moving on to the paragraph, I applied appropriate styles to ensure they aligned with the provided design.&lt;/p&gt;

&lt;p&gt;I used the "&lt;a href="https://chrome.google.com/webstore/detail/perfectpixel-by-welldonec/dkaagdgjmgdmbnecmcefdhjekcoceebi" rel="noopener noreferrer"&gt;Perfect Pixel&lt;/a&gt;" extension to ensure precise pixel-sized programming since I only had an image of the design and not a Figma or Adobe XD file.&lt;/p&gt;

&lt;h2&gt;
  
  
  JavaScript Implementation
&lt;/h2&gt;

&lt;p&gt;As I delved into the JavaScript implementation, I initially planned to create an event listener that would toggle classes with each click, allowing for seamless show/hide functionality. However, upon re-reading the challenge requirements, I realized the need to incorporate the &lt;strong&gt;window.getComputedStyle()&lt;/strong&gt; method.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Understanding the question is half the answer.&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Taking a Closer Look at &lt;code&gt;getComputedStyle()&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Window.getComputedStyle()&lt;/strong&gt; method returns an object containing the values of all CSS properties of an element, after applying active stylesheets and resolving any basic computation those values may contain &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle" rel="noopener noreferrer"&gt;[2]&lt;/a&gt;. By utilizing this function, we can retrieve the &lt;strong&gt;visibility property value&lt;/strong&gt; and manipulate it accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;To bring the challenge to life, I wrote the following JavaScript code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;actionBtn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.action__btn&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;actionCtn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.action__content&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;CtnComptStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getComputedStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;actionCtn&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;setOpacity&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;CtnComptStyle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;visibility&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;visible&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;actionCtn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;visibility&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hidden&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;actionCtn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;visibility&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;visible&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;actionBtn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setOpacity&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code above checks the visibility styling of the paragraph element when the button is clicked. By toggling the visibility property between 'visible' and 'hidden', the paragraph is displayed or hidden accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Github: &lt;a href="https://github.com/mouatezbenariba/Elzero-Frontend-Challenges/tree/main/show-hide-paragraph" rel="noopener noreferrer"&gt;Show/Hide paragraph Challenge&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Demo: &lt;a href="https://mouatezbenariba.github.io/Elzero-Frontend-Challenges/show-hide-paragraph/" rel="noopener noreferrer"&gt;Show/Hide paragraph Challenge&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Codepen: &lt;a href="https://codepen.io/mouatezbenariba/pen/poxBvga" rel="noopener noreferrer"&gt;Show/Hide paragraph Challenge&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Understanding the challenge requirements is crucial for success. Take the time to comprehend the task before diving into implementation.&lt;/li&gt;
&lt;li&gt;Adopt best practices such as using structured HTML, following naming conventions, and applying appropriate CSS styles.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;getComputedStyle&lt;/strong&gt; to access and manipulate computed styles of elements dynamically.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Give it a Try!
&lt;/h2&gt;

&lt;p&gt;I invite you to rate my work and give it a try yourself. Engaging in frontend challenges like this one can be an excellent opportunity to enhance your skills, expand your knowledge, and improve your problem-solving abilities.&lt;/p&gt;

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