PDA

View Full Version : make a button or command that printout's value stored in a variable.


Tauheed
06-28-2003, 11:57 PM
hio,
hoping all the buddies in best of ur every thing.


Problem :
i stored a value "tauheed" in a variable 'a', now i need a command that will print value of variable 'a' when ever i press a button.

Plz send me coding for.

1. Syntax (code) for printing the value of variable 'a i.e. "tauheed".

2. Syntax (code) for making link b/w the button and print command.

thank u for viewing my problem.

SDP2006
06-29-2003, 02:41 AM
Do you mean this? I don't know if this is right. I am a beginner.
Someone correct me if this isn't.

<html>
<head>
<script language="text/JavaScript">
var a = "tauheed"
function tauheed()
{
window.print(a);
}
</script>
</head>
</body>
<input type="button" value="print" onClick="tauheed();">
</body>
</html>