Html/Javascript help????????

Andy

New member
I want a textarea and a button. Like this:

<textarea id="test"></textarea>
<input type="button">

I want it so when you click onto the button then type into the text area the text is bold though when you click onto the button again the bold text stops and normal text continues.

To put it in a more simple format i want a bold button like in microsoft word.

You can use this function for the button clicks:

script type="text/javascript">
<!--
var i;
function twoAlerts() {
if(i==1) {

i=0;
}
else {

i=1;
}
}
//-->
</script>

<input type="button" name="test" onclick="twoAlerts()>
<textarea id="test"></textarea>
 
That's a bit hard to do, specially to make it work in all browsers. I recommend you to download and install the TinyMCE, which is a very good online editor for your website:

http://tinymce.moxiecode.com/download.php

You can see it working here:
http://tinymce.moxiecode.com/examples/full.php
 
Back
Top