Cannot get disable button to work.
Posted
by Scarface
on Stack Overflow
See other posts from Stack Overflow
or by Scarface
Published on 2010-04-10T04:59:40Z
Indexed on
2010/04/10
5:03 UTC
Read the original article
Hit count: 133
jQuery
|JavaScript
Hey guys, quick question, I have this javascript/jquery function that basically wraps an input in image brackets, and the first part of the function works, but the button does not disable after and I cannot figure out why (last line does not work). If anyone has an idea, let me know. Thanks in advance.
<input id="2image" type="button" value="Attach" onclick="imageid('message')">
<script>
function imageid(input) {
var obj=document.getElementById(input);
obj.value+="[image]image[/image]";
$("#2image").attr({ disabled:true, value:"Inserted" });
}
</script>
© Stack Overflow or respective owner