question

+1 pranav reddy A · January 23, 2015
is there any way i can add the variable in the middle of string...without using an other write statement???
i mean like my name document.write("my name is"+name "my age is"+age);

Post a Reply

Replies

Oldest  Newest  Rating
+1 Luke Shimkus · April 14, 2015
You can just combine them using the a +. If you want them on different lines then try using the "<br/>" HTML tag. For example,
document.write("my name is " + name + "" + "my age is" + age);
  • 1

Javascript

107,076 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators