0

The problem is... i want <anytag id="blah" class="blahblah" myattrwithoutvalue> BUT looking at console.log($("#blah").html()); i see:

myattrwithoutvalue="" - The third-party plugin dont accept it.

$(selector).attr("attribute") without value or $(selector).attr("attribute",null) dont insert any attribute.

How to solve this?

var table = "";
table += "<table id='table1'>\n";
table += "</table>\n";
$("#place1").html(table);
$("#table1").addClass("myclass");
$("#table1").attr("mynewattr","");
var ptable = $("#place1").html();
console.log(ptable);

Console

<table id="table1" class="myclass" mynewattr="">
</table>

Html

<div id="place1">
</div>

1 Answers1

1

Thank you all guys. I did contact with the library owner and pointed the problem. Some hours later He sent an email announcing the new fixed version at github. I apologize.