am trying to make a html program in which theres a function which will take a single argument and then it will be type of argument passed i.e whether it is an integer type or string or float and print the same.I tried making it and cud do it by using "on button click".but i am not getting how to to it without "button onclick".i just want to print the type of data passed without any button onclick.
can anyone here hep me with it.heres what i did:
<html>
<head>
<script language="JavaScript">
function datatype()
{
}
function check(arg)
{
document.write(typeof(arg));
}
var data=new datatype();
</script>
</head>
<body>
<input type="button" onclick="(data)" value="Object">
<input type="button" onclick="check(5)" value="Number">
<input type="button" onclick="check('Hello')" value="String">
</body>
</html>


