Somewhere I've made a mistake in the btn.attr() but can't find it. Or apparently it doesn't work like I thought it would,so now I'm confused. I could do it in javascript with "with" but I'd love to learn how to do it in jquery also. So here is the code:
function setattr(id, value) {
var btn = document.createElement('input');
btn.setAttribute('type', 'button');
btn.attr({
id: id,
class: "btnclass",
value: "value"
});};
Could I have also used $(this) somehow?
"herevalue: "value..