Link to home
Start Free TrialLog in
Avatar of dpacker_coors
dpacker_coors

asked on

Is it possible to pass parameters to replace text in a JavaScript

Is there a way to dynamically replace text with JavaScript?  

An example in c# would be Console.WriteLine("{0}, the answer is {1}.", "Dan", "Forget it");
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dpacker_coors
dpacker_coors

ASKER

Thanks - sprintf provides exactly what I need.

I'm creating a hidden (style.visiblity = none) <div> on a web page that stores "generic" description information such as "The item is %f inches across and is colored %s".  When the user clicks on a product I want to show the <div> and display the appropriate item characteristics by replacing text.

-Dan
display="none"