setAttribute method doesnt set specific thing


#1

I am using meteor with polymer and i want body element like that:

<body class="fullbleed" unresolved>

in client/init.js

Meteor.startup(function(){
    document.querySelector('body').setAttribute('class', 'fullbleed');
    document.querySelector('body').setAttribute('unresolved', '');
});

Its returning only <body class="fullbleed">

When i tried this:

 document.querySelector('body').setAttribute('class', 'fullbleed');
 document.querySelector('body').setAttribute('id', 'somevalue');

Its returning <body class="fullbleed" id="somevalue">

setAttribute method doesnt set specific attribute, its not critical thing but i wondered why?


#2

This feels like a JavaScript issue more than a Meteor issue.

That said, have you tried passing other things as the second setAttribute parameter like false, undefined, or null?


#3

Nope. I think, its not related JavaScript.

  1. Inputs:

    .setAttribute(‘unresolved’, true);
    false
    undefined
    null

Output: <body class="fullbleed">

  1. Inputs:

    .setAttribute(‘id’, null);
    false
    undefined
    true

Output: <body class="fullbleed" id="null">