I want to set the attribute of an element using javascript and not jQuery, the jQuery would be this, but how would the javascript be?
$("param[name='wmode']").attr("value","opaque");
You can use setAttribute DOM Element method:
element.setAttribute("value","opaque");
So your code without jQuery should be like:
document.querySelector("param[name='wmode']").setAttribute("value","opaque");
You can set attribute of any element by using setAttribute function. In your case it will be
document.getElementById('myelement').setAttribute('name', 'My_Element');
You can learn more about this at http://www.w3schools.com/jsref/met_element_setattribute.asp
Thanks