Forum Moderators: open
alert(typeof my_id_or_javascript_object);
window.onload = function()
{
do_something1();
do_something2();
do_something3();
}
example()
{
var a = 0;
a = 1;
alert(a);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Example</title>
<base href="http://localhost/project_subdirectory/" />
<link rel="stylesheet" href="textstyle.css" type="text/css" />
<script type="application/javascript">
//<![CDATA[
/*
Your scripts go here for test, in a separate file for live environments for cache.
Keep your onload event and global variables in a separate onload.js file, all other scripts in index.js
*/
window.onload = function()
{
alert('oh hai!');
alert(document.getElementById('input_id1').value+'\n\n'+typeof document.getElementById('input_id1'));
//do_something1();
//do_something2();
//do_something3();
}
//]]>
</script>
</head>
<body>
<form action="/" method="post">
<fieldset>
<div><label for="input_id1">label text</label><input id="input_id1" name="input_id1" type="text" value="11aa" /></div>
<div><label for="input_id2">label text</label><input id="input_id2" name="input_id2" type="text" value="22bb" /></div>
<div><label for="input_id3">label text</label><input id="input_id3" name="input_id3" type="text" value="33cc" /></div>
</fieldset>
</form>
<div><p>Use the base element in conjunction with any href and src attributes, in example <a href="example1/">example</a>.</p>
</body>
</html>