Previous Example-|-Next Example-|-Return to Chapter Listing

Example 5.8:
String Operators: the Concatenation Operator


Click this button to see the value in the sFullName variable, the result of concatenating (linking together) strings:


This is the script we used. First we placed this in the HEAD: <SCRIPT LANGUAGE="JAVASCRIPT"> <!-- var sFirstName = "Derek" var sLastName = "Halfabee" var sFullName = sFirstName + " " + sLastName //--> </SCRIPT> Then we created this button: <form> <input type="button" name="VariableButton" value="The result of the calculation" onclick="alert(sFullName)"> </form>
Previous Example-|-Next Example-|-Return to Chapter Listing