Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Using value " null" in HTML attributes

$
0
0
I am using HTML attributes to bind data. Framework CanJS.

    I am using a `<div data-name="<%= items[1]%>"><%= items[1]%></div>` tag in file ejs

 
With attr name is data-name have value is "null" (items[1] = "null").

First point : If you using <%= items[1]%> type (one "=")is data display as below:

   

    <div data-name=""">"</div>

Second point : If you using <%== items[1]%> type (two "=") is data display as below:
   
   

    <div data-name=""">null</div>

 
I do not know why, data-name display so ("). Thank you!

Viewing all articles
Browse latest Browse all 3491

Trending Articles