Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (30 sloc) 810 Bytes
<html>
<head>
<title>myFrame</title>
</head>
<script>
function domUtils(document) {
this.document = document;
alert(this.document.getElementById("test"));
this.getElementById = function(id) {
var _id = id;
var _domElement = this.document.getElementById(_id);
if (_domElement == null) {
alert("dom element name=" + _id + " does not exist in getElementById");
}
return this.document.getElementById(_id);
}
}
</script>
<body>
<form action="">
<input type="text" id="test" value="hello">
<input type="text" id="test2" value="hello2">
</form>
<script>
//var _domUtils = new domUtils(document);
//var test = _domUtils.getElementById("test");
//alert(test.value);
</script>
</body>
</html>