javascript add attribute to element without value code example Example: jquery add attribute without value $('body').attr('data-body','');