/    Sign up×
Community /Pin to ProfileBookmark

I am making an HTML Builder. I want a thing where the visitor selects some text and is then able to apply HTML formatting to it. There would be buttons like B, I, U, Center, etc. Similar to this forum. I am making a script for it right now, but it’s not working. Please help! Thanx.

<script languge=”JavaScript”>

function ChangeTxt(form) {
var txt=””;
txt+=””;
if (form.text.value) {
txt+=”<b>” + form.text.select() + “</b>”;
}
else {
txt+=””;
}
form.text.value=txt;
}

</script>

<form>
<textarea cols=”65″ rows=”10″></textarea>
<br>
<center><input type=”button” value=”Change” onClick=”ChangeTxt(this.form);”></center>
</form>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@RyanNov 20.2002 — well, if you cut and pasted your script, the problem is this:

<script languge="JavaScript">

one: language is spelled wrong.

two: the "type" attribute should be used instead.

<script type="text/javascript">

Happy Coding.
Copy linkTweet thisAlerts:
@Zach_ElfersauthorNov 21.2002 — I just typed that now. I didn't cut and paste the script. What do you mean by type? Can somebody please rewrite the script for me? Thanx.? ?
Copy linkTweet thisAlerts:
@JordanJ6Sep 05.2018 — Hi everyone! just go through your topic and decide to write about my experience in HRT, maybe someone will find it useful to him. When I was at the age of 40 I begin to feel fatigue, gaining weight and libido start to crawl down. Of course, that didn't suit me. So I dig up the whole internet to find the best solution. It was clinic in Dallas https://dallas.hghtherapydoctor.us/ where I start my long road of treatment. And if don't go into details, after 6 months I began to breathe deeply, start going to the gym and my libido returned to normal. So for everybody who feels now like I felt before. Make an appointment with doctor and he will help.
×

Success!

Help @Zach_Elfers spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 11.14,
social: @webDeveloperHQ,
});

legal: ({
terms: of use,
privacy: policy
analytics: Fullres
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: Anonymous,
tipped: article
amount: 1000 SATS,

tipper: @aldoushuxley,
tipped: article
amount: 1000 SATS,

tipper: Anonymous,
tipped: article
amount: 1000 SATS,
)...