What I want to do is all too unbelievably simple. I have a function that inserts <B> and </B> tags around whatever is highlighted in a text area. When called with an <INPUT> button, it works fine, as in:
<INPUT TYPE="button" VALUE="Bold" ONCLICK="insertAtCaret(this.form.txtOther, document.selection.createRange().text.bold());">
All I want to do is use an *image* instead of a clunky <INPUT> button to fire the 'insertAtCaret' function. I have tried everything I can think of:
* putting the ONCLICK statement within the <IMG> tag
* putting the ONCLICK statement within an <A HREF="#" ...> tag around the image
* calling the function from the <A HREF> attribute itself, as in HREF="javascript:insertAtCaret [etc...]"
Nothing works that I can think of. Does anybody have any advice? Thanks in advance.
<INPUT TYPE="button" VALUE="Bold" ONCLICK="insertAtCaret(this.form.txtOther, document.selection.createRange().text.bold());">
All I want to do is use an *image* instead of a clunky <INPUT> button to fire the 'insertAtCaret' function. I have tried everything I can think of:
* putting the ONCLICK statement within the <IMG> tag
* putting the ONCLICK statement within an <A HREF="#" ...> tag around the image
* calling the function from the <A HREF> attribute itself, as in HREF="javascript:insertAtCaret [etc...]"
Nothing works that I can think of. Does anybody have any advice? Thanks in advance.