<?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: S M Ashraful Azom</title>
    <description>The latest articles on DEV Community by S M Ashraful Azom (@ashrafulazom).</description>
    <link>https://dev.to/ashrafulazom</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%2F576885%2F34cdd676-296d-4daf-a23a-b28bec3ee995.jpeg</url>
      <title>DEV Community: S M Ashraful Azom</title>
      <link>https://dev.to/ashrafulazom</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ashrafulazom"/>
    <language>en</language>
    <item>
      <title>how to show my post like Last image with below code?</title>
      <dc:creator>S M Ashraful Azom</dc:creator>
      <pubDate>Fri, 07 Apr 2023 15:10:26 +0000</pubDate>
      <link>https://dev.to/ashrafulazom/how-to-show-my-post-like-last-image-with-below-code-kfi</link>
      <guid>https://dev.to/ashrafulazom/how-to-show-my-post-like-last-image-with-below-code-kfi</guid>
      <description>&lt;p&gt;I provide here some CSS,html and JavaScript code, what i using in my &lt;br&gt;
Blogspot site. this code show my post like 1st image style. &lt;/p&gt;

&lt;p&gt;now I want to show my post like 2nd image style. &lt;/p&gt;

&lt;p&gt;So How to write or modify my CSS and JavaScript code to show post like 2nd image?&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;style&amp;gt;
    label-posts-container .label-post img {
    height: 50px;
    object-fit: cover;
    width: 100%;
    display: flex;
    }

    .label-posts-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #fff;
    padding: 10px;
    margin: 10px 0;
    align-items: center;
    }
    .label-posts-container .label-post {
    background: #fff;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 40px -8px rgba(0, 0, 0, 0.3);
    }

    .label-posts-container .thumb-container {
    flex: 0.75;
    width: 100%;
    }

    .label-posts-container .text-content {
    flex: 2;
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    }
    .label-posts-container .post-title-container {
    text-decoration: none;
    }
    .label-posts-container .post-title-container:hover {
    text-decoration: underline;
    }

    .label-posts-container .post-title {
    margin: 0;
    font-size: 15px;
    margin-bottom: 5px;
    color: #000;
    line-height: 1.2;
    }
    &amp;lt;/style
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class='label-posts-container national'&amp;gt;Posts related to National:&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;   
    const National = document.querySelector(".national");

    const populateLabelPosts = (data, container) =&amp;gt; {
    data.forEach(post =&amp;gt; {
    const thumbContainer = document.createElement('a');
    thumbContainer.href = post.link[post.link.length - 1].href;
    thumbContainer.classList.add('thumb-container');

    const thumbnail = document.createElement('img');
    thumbnail.src = post.media$thumbnail.url.replace('/s72', '/s300');

    thumbContainer.appendChild(thumbnail);

    const textContent = document.createElement('div');
    textContent.classList.add('text-content');

    const postTitleContainer = document.createElement('a');
    postTitleContainer.href = post.link[post.link.length - 1].href;
    postTitleContainer.classList.add('post-title-container');   

    const title = document.createElement('h3');
    title.classList.add('post-title');
    title.innerHTML = post.title.$t;

    postTitleContainer.appendChild(title);

    textContent.appendChild(postTitleContainer);

    const labelPost = document.createElement('div');
    labelPost.classList.add('label-post');

    labelPost.appendChild(thumbContainer);
    labelPost.appendChild(textContent);

    container.appendChild(labelPost);
    });

    }

    const displayNational = (posts) =&amp;gt; {
    populateLabelPosts(posts.feed.entry, National);
    }
    &amp;lt;/script&amp;gt;   
    &amp;lt;script src='https://www.sebahotnews.org/feeds/posts/summary/-/জাতীয়?max-results=5&amp;amp;amp;alt=json-in-script&amp;amp;amp;callback=displayNational'&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using above this code showing like this Image 1 style.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n0NGhqhb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/csahzyxouitm3rbbk6or.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n0NGhqhb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/csahzyxouitm3rbbk6or.jpg" alt="image 1" width="297" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But i want to show my post like below Image 2 using above code. so how to modify my code?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WT9ZljWh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/16pc2q2e10di7xri66yk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WT9ZljWh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/16pc2q2e10di7xri66yk.jpg" alt="Image 2" width="798" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>html</category>
      <category>blogspot</category>
    </item>
    <item>
      <title>how to create post like this cover photo with below code?</title>
      <dc:creator>S M Ashraful Azom</dc:creator>
      <pubDate>Thu, 23 Mar 2023 16:23:16 +0000</pubDate>
      <link>https://dev.to/ashrafulazom/how-to-create-post-like-this-cover-photo-with-below-code-5b1p</link>
      <guid>https://dev.to/ashrafulazom/how-to-create-post-like-this-cover-photo-with-below-code-5b1p</guid>
      <description>&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&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;style&amp;gt;

.label-posts-container .label-post img {
  height: 200px;
  object-fit: cover;
  width: 100%;
  display: flex;
}

.label-posts-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
    background: #fff;
    padding: 24px;
    margin: 32px 0;
    align-items: center;
}

.label-posts-container .label-post {
  background: #fff;
  display: flex;
  align-items: center;
  max-width: 700px;
  box-shadow: 0 4px 40px -8px rgba(0, 0, 0, 0.3);
}

.label-posts-container .thumb-container {
  flex: 1;
  width: 100%;
}

.label-posts-container .text-content {
  flex: 2;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
}

.label-posts-container .post-title-container {
  text-decoration: none;
}

.label-posts-container .post-title-container:hover {
  text-decoration: underline;
}

.label-posts-container .post-title {
  margin: 0;
  font-size: 24px;
  margin-bottom: 8px;
  color: #ef233c;
line-height: 1.2;
}

.label-posts-container .summary {
  line-height: 1.8;
  color: #023047;
  opacity: 0.9;
  position: relative;
  height: 80px;
  overflow: hidden;
  margin-bottom: 8px;
}

.label-posts-container .summary::after {
  content: &amp;amp;quot;&amp;amp;quot;;
  position: absolute;
  bottom: 0;
  left: 0;
  height: 32px;
  width: 100%;
  background: linear-gradient(transparent, #fff);
}

.label-posts-container .read-more-btn {
  color: darkblue;
  font-weight: bold;
  font-size: 13px;
  text-transform: uppercase;
  text-decoration: none;
  align-self: flex-end;
}

@media (max-width: 640px) {
  .label-posts-container .label-post {
    flex-direction: column;
  }

  .label-posts-container .label-post img {
    width: 100%;
    height: 200px;
  }
}

&amp;lt;/style&amp;gt;

&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;div class='label-posts-container national'&amp;gt;
    Posts related to জাতীয়:
&amp;lt;/div&amp;gt;

&amp;lt;script&amp;gt;

    const National = document.querySelector(".national");

    const populateLabelPosts = (data, container) =&amp;gt; {
    data.forEach(post =&amp;gt; {
        const thumbContainer = document.createElement('a');
        thumbContainer.href = post.link[post.link.length - 1].href;
        thumbContainer.classList.add('thumb-container');

        const thumbnail = document.createElement('img');
        thumbnail.src = post.media$thumbnail.url.replace('/s72', '/s300');

        thumbContainer.appendChild(thumbnail);

        const textContent = document.createElement('div');
        textContent.classList.add('text-content');

        const postTitleContainer = document.createElement('a');
        postTitleContainer.href = post.link[post.link.length - 1].href;
        postTitleContainer.classList.add('post-title-container');   

        const title = document.createElement('h3');
        title.classList.add('post-title');
        title.innerHTML = post.title.$t;

        postTitleContainer.appendChild(title);

        textContent.appendChild(postTitleContainer);

        const labelPost = document.createElement('div');
        labelPost.classList.add('label-post');

        labelPost.appendChild(thumbContainer);
        labelPost.appendChild(textContent);

        container.appendChild(labelPost);
    });

    }

    const displayNational = (posts) =&amp;gt; {
        populateLabelPosts(posts.feed.entry, National);
    }

&amp;lt;/script&amp;gt;
&amp;lt;script src='https://www.sebahotnews.org/feeds/posts/summary/-/জাতীয়?max-results=5&amp;amp;amp;alt=json-in-script&amp;amp;amp;callback=displayNational'&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;



</description>
      <category>javascript</category>
      <category>css</category>
      <category>html</category>
    </item>
    <item>
      <title>How to support 3rd Party image in blogspot recent post with below js code?</title>
      <dc:creator>S M Ashraful Azom</dc:creator>
      <pubDate>Sat, 04 Dec 2021 13:53:50 +0000</pubDate>
      <link>https://dev.to/ashrafulazom/how-to-support-3rd-party-image-in-blogspot-recent-post-with-below-js-code-4672</link>
      <guid>https://dev.to/ashrafulazom/how-to-support-3rd-party-image-in-blogspot-recent-post-with-below-js-code-4672</guid>
      <description>&lt;p&gt;I use the following code for recent posts on my blogspot site.&lt;/p&gt;

&lt;p&gt;When I upload a new image to my blog, most of the time the images are uploaded via a link like https: //1.bp.blogspot.com / ......&lt;/p&gt;

&lt;p&gt;But sometimes when uploading pictures, the pictures are uploaded by such links as https: //blogger.googleusercontent.com/img/a/A ......&lt;/p&gt;

&lt;p&gt;Then my pictures are not clear on the home page. And the pictures come at length. I did a Google search and found that the code below does not support third party images.&lt;/p&gt;

&lt;p&gt;So I want to know how I can support third party pictures in this code below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.mbtlist {
  list-style-type: none;
  overflow: hidden
  }

  .mbtlist li {
  margin: 0px auto 20px auto;
  clear: both;
  color: #666;
  font-family: Helvetica;
  font-size: 12px;
  border-bottom: 1px dotted #ddd;
  padding-bottom: 10px;
  }

  .mbtlist .mbttitle {
  font-family: oswald;
  font-size: 16px;
  color: #0080ff;
  font-weight: normal;
  text-decoration: none;
  }

 .mbtlist .mbttitle:hover {
 color: #00A5FF;
 }

font-family:georgia;
font-size:15px;
font-weight:bold
}
.mbtlist div span {
 margin: 0 10px 0 0;
 display: inline-block;
 }
.mbtlist span {
 display: block;
 margin: 5px 0px 0px;
 padding-right: 5px;
 }
.mbtlist .imore {
 font-size: 16px;
 font-weight: bold;
 text-decoration: none;
 color: #666;
 line-height: 0.7em;
 }
 .mbtlist .mbttitle .imgbox {
  max-width: 80px;
  max-height: 65px;
  margin: 0px 10px 10px 0px;
  padding: 6px;
  box-shadow: -1px -1px 4px #777;
  display: inline-block;
  vertical-align: top;
  text-align: center;
  overflow: hidden;
  }
 .mbtlist .mbttitle .imgbox &amp;gt; img{
  width: 100%;
  vertical-align: middle;
  }


 .mbtlist li:first-of-type .mbttitle .imgbox
  {
  display: block;
  width: 100%;
  max-width: unset;
  max-height: unset;
  }

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
  function getPosts(json) {
  var posts = "&amp;lt;ul class=mbtlist&amp;gt;";
  for (var i = 0; i &amp;lt; json.feed.entry.length; i++) {
  var title = json.feed.entry[i].title.$t;
  var url = json.feed.entry[i].link.pop().href;
  if (json.feed.entry[i].media$thumbnail) {
    thumbUrl = json.feed.entry[i].media$thumbnail.url;
    thumbnail = thumbUrl.replace("/s72-c/", "/s" + 200 + "/");
  }

  posts += "&amp;lt;li&amp;gt;&amp;lt;a class='mbttitle' href='" + url + "'&amp;gt;&amp;lt;span class='imgbox'&amp;gt;&amp;lt;img src='" + thumbnail + "'&amp;gt;&amp;lt;/span&amp;gt;" + title + "&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;";
}
posts += '&amp;lt;/ul&amp;gt;';
document.getElementById('container').innerHTML = posts;
  }
 &amp;lt;/script&amp;gt;

 &amp;lt;div id="container"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;script src="https://www.sebahotnews.org/feeds/posts/default/-/বাংলাদেশ
?max-results=5&amp;amp;alt=json&amp;amp;callback=getPosts"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Answer: How to Fix Uncaught ReferenceError: thumbnail is not defined - with below code</title>
      <dc:creator>S M Ashraful Azom</dc:creator>
      <pubDate>Mon, 31 May 2021 07:14:05 +0000</pubDate>
      <link>https://dev.to/ashrafulazom/answer-how-to-fix-uncaught-referenceerror-thumbnail-is-not-defined-with-below-code-4421</link>
      <guid>https://dev.to/ashrafulazom/answer-how-to-fix-uncaught-referenceerror-thumbnail-is-not-defined-with-below-code-4421</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Gn-iPj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/67765317/how-to-fix-uncaught-referenceerror-thumbnail-is-not-defined-with-below-code/67765939#67765939" rel="noopener noreferrer"&gt;
              &lt;span class="title-flare"&gt;answer&lt;/span&gt; re: How to Fix Uncaught ReferenceError: thumbnail is not defined - with below code
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;May 30 '21&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/67765317/how-to-fix-uncaught-referenceerror-thumbnail-is-not-defined-with-below-code/67765939#67765939" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9mJpuJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          1
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wif5Zq3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;it happens because some posts does not have images or images hosted externally, we can use a fallback image like this&lt;/p&gt;
&lt;pre class="lang-js prettyprint-override"&gt;&lt;code&gt;for (var i = 0; i &amp;lt; json.feed.entry.length; i++) {
    var title = json.feed.entry[i].title.$t
    var url = json.feed.entry[i].link.pop().href;

    // define thumbnail variable
    var thumbnail;

    if (json.feed.entry[i].media$thumbnail) {
        thumbUrl =&lt;/code&gt;&lt;/pre&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/67765317/how-to-fix-uncaught-referenceerror-thumbnail-is-not-defined-with-below-code/67765939#67765939" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>How to avoid document.write from this code?</title>
      <dc:creator>S M Ashraful Azom</dc:creator>
      <pubDate>Wed, 10 Feb 2021 07:22:07 +0000</pubDate>
      <link>https://dev.to/ashrafulazom/how-to-avoid-document-write-from-this-code-3452</link>
      <guid>https://dev.to/ashrafulazom/how-to-avoid-document-write-from-this-code-3452</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    var banglaDigit = {'0': '০','1': '১','2': '২','3': '৩','4': '৪','5': '৫','6': '৬','7': '৭','8': '৮','9': '৯'};
    var dayName = new Array("রবিবার", "সোমবার", "মঙ্গলবার", "বুধবার", "বৃহস্পতিবার", "শুক্রবার", "শনিবার")

    var monName = new Array("জানুয়ারী", "ফেব্রুয়ারী", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগষ্ট",
        "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর")

    var now = new Date;

    document.write("আজ " + dayName[now.getDay()] + ", " + now.getDate().toString().replace(/[0123456789]/g, function(s) {
                return banglaDigit[s];
            }) + " " + monName[now.getMonth()] + " " + now
        .getFullYear().toString().replace(/[0123456789]/g, function(s) {
                return banglaDigit[s];
            }) + "ইং ")

    date = new Date();
    hours = date.getHours();
    mins = date.getMinutes();
    secs = date.getSeconds();

    shift='';
    if (hours == 0) {
        shift = " AM";
        hours = 12
    } else if (hours &amp;amp;lt;= 3) {
        shift = " AM"
    } else if (hours == 12) {
        shift = " PM";
        hours = 12
    } else if (hours &amp;amp;gt;= 13) {
        shift = " PM";
        hours -= 12
    }

    if (mins &amp;amp;lt;= 9) {
        mins = "0" + mins
    }

    document.write("* সময়ঃ " + hours.toString().replace(/[0123456789]/g, function(s) {
                return banglaDigit[s];
            }) + " টা :" + mins.toString().replace(/[0123456789]/g, function(s) {
                return banglaDigit[s];
            }) + " মিনিট *");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
</description>
      <category>javascript</category>
    </item>
    <item>
      <title>how to avoid document.write my below code</title>
      <dc:creator>S M Ashraful Azom</dc:creator>
      <pubDate>Wed, 10 Feb 2021 06:44:37 +0000</pubDate>
      <link>https://dev.to/ashrafulazom/how-to-avoid-document-write-my-below-code-200g</link>
      <guid>https://dev.to/ashrafulazom/how-to-avoid-document-write-my-below-code-200g</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Gn-iPj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/65979976/how-to-avoid-document-write-my-below-code" rel="noopener noreferrer"&gt;
              how to avoid document.write my below code
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Jan 31 '21&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 1&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/65979976/how-to-avoid-document-write-my-below-code" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9mJpuJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          1
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wif5Zq3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;This code is working, but google pagespeed detect avoid &lt;code&gt;document.write&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I've tested various alternatives, lining up my HTML elements prior to the &lt;code&gt;JS&lt;/code&gt;, then using &lt;code&gt;getElementById&lt;/code&gt;, followed by either &lt;code&gt;innerHTML&lt;/code&gt; or &lt;code&gt;appendChild&lt;/code&gt;, or even lining up the elements inside the &lt;code&gt;JS&lt;/code&gt;, by means of &lt;code&gt;createElement&lt;/code&gt;…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/65979976/how-to-avoid-document-write-my-below-code" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
  </channel>
</rss>
