<?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: bryancasler</title>
    <description>The latest articles on DEV Community by bryancasler (@bryancasler).</description>
    <link>https://dev.to/bryancasler</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%2F313363%2F59301037-477f-4aa0-a4d1-533e97fbf8e5.jpeg</url>
      <title>DEV Community: bryancasler</title>
      <link>https://dev.to/bryancasler</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bryancasler"/>
    <language>en</language>
    <item>
      <title>TIL: Data Attributes are way easier to use than I realized </title>
      <dc:creator>bryancasler</dc:creator>
      <pubDate>Fri, 14 Aug 2020 16:44:56 +0000</pubDate>
      <link>https://dev.to/bryancasler/til-data-attributes-are-way-easier-to-use-than-i-realized-4gj0</link>
      <guid>https://dev.to/bryancasler/til-data-attributes-are-way-easier-to-use-than-i-realized-4gj0</guid>
      <description>&lt;p&gt;Today I learned about how "dataset" can be leveraged in Javascript to quickly retrieve a data attribute on an object. Per the MSDN docs, note that dashes are converted to camelCase.&lt;/p&gt;

&lt;p&gt;And this approach has 99%+ support in browsers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;article
  id="electric-cars"
  data-columns="3"
  data-index-number="12314"
  data-parent="cars"&amp;gt;
...
&amp;lt;/article&amp;gt;

&amp;lt;script&amp;gt;
const article = document.querySelector('#electric-cars');

article.dataset.columns // "3"
article.dataset.indexNumber // "12314"
article.dataset.parent // "cars"
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;REF: &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes"&gt;https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes&lt;/a&gt;&lt;/p&gt;

</description>
      <category>html</category>
    </item>
    <item>
      <title>TIL: HTML Comments are valid inside Javascript</title>
      <dc:creator>bryancasler</dc:creator>
      <pubDate>Sat, 08 Aug 2020 19:07:25 +0000</pubDate>
      <link>https://dev.to/bryancasler/til-html-comments-are-valid-inside-javascript-1g2p</link>
      <guid>https://dev.to/bryancasler/til-html-comments-are-valid-inside-javascript-1g2p</guid>
      <description>&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script type="text/javascript"&amp;gt;
// This is a valid comment
&amp;lt;!-- This is a valid comment too
&amp;lt;!--
function message() {
  alert("Hello World!")
}
//--&amp;gt;
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The two forward slashes at the end of comment line (//) is the JavaScript comment symbol. This prevents JavaScript from executing the --&amp;gt; tag. - &lt;a href="https://www.w3schools.com/tags/tag_comment.asp"&gt;w3schools&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;REF: &lt;a href="https://github.com/denysdovhan/wtfjs#html-comments-are-valid-in-javascript"&gt;https://github.com/denysdovhan/wtfjs#html-comments-are-valid-in-javascript&lt;/a&gt;&lt;/p&gt;

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