/    Sign up×
Community /Pin to ProfileBookmark

Frustrating Problem with TextAreas in javascript

I’ve been at this for awhile, and it’s really getting annoying, all my books say that /n makes a new line in javascript, i’ve put it in every which way I can think of, but it isn’t rendering a new line, it just appears as /n, here is the code

document.gradecalc.display.value=”Your Midterm score is “
+ midterm.toFixed(2) + “Your Finals score is ” + finalg.toFixed(2)
+ “Your Improvement bonus is ” + bonus +
“Your average with bonus is ” + result.toFixed(2) +
“Your Final Grade is ” + grade;

I’ve tried adding seperate lines that say +”/n” +/n
and I’ve also tried adding the /n inside the parenthesis for my string values
as well as outside, nothing renders properly, it’s going to drive me completley insane. If you need the complete code, let me know

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@ScriptageDec 05.2005 — <form>

<textarea name="one"></textarea>

</form>

<script>

document.forms[0].one.value = "hellonworld";

</script>

You need to use a backslash to escape a charcter.

Regards
Copy linkTweet thisAlerts:
@TalishanauthorDec 05.2005 — omg, thanks, my textbooks suck, I could have done this for an eternity and not realized I was looking at a backslash
×

Success!

Help @Talishan 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 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...