Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript syntax

Status
Not open for further replies.

Candyb

Technical User
Oct 2, 2001
12
CA
Hi,
I was just wondering how you would write the following?

I have a var id = 1;
What is the syntax to insert this variable into a string? if it is possible?
Or a string of single quotes?

Thanks,

Candy
 
Here you go.
Code:
var id = 1
var id_string = id.toString()

Hope this helps..

ToddWW
 
or:

var txt = "blah blah blah" + id

or:

var txt = "blah blah";
var id = 1;
id.toString();
var newString = txt.concat(id) -Greg :-Q

flaga.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top