Demonstrating the valueOf() method : valueOf : Number Data Type JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Number Data Type » valueOf »

 

Demonstrating the valueOf() method

















<html>
<head>
<title>Demonstrating the valueOf() method</title>
<script type="text/javascript" language="javascript">
<!-- //
function DisplayValue(){
    var entry1 ;
    entry1 = prompt("Enter a floating point number""123.123");
    var number = new Number();
    number = Number(entry1);
    if (isNaN(number)){
        document.write("<P>You did not enter a valid number.<br />");
    }
    else{
        document.write(number.valueOf() "</p>");
    }
}
// -->
</script>
</head>
<body onload="DisplayValue()">
<P>This listing demonstrates the use of the valueOf() method.</p><br />
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Number Data Type
» valueOf