I am trying to use SetAttribute to append a custom attribute to a form input. The code is below. Please help.
function getpostdata(){
// Append the values
var uploader = document.getElementById("uploader");
uploader.setAttribute("room_name", "test");
uploader.setAttribute("album_title", "test");
}
What exactly is the problem? the attributes are not set? It would be expected behavior if you run the script before the element in question is not yet loaded in the DOM