<!-- Part of javalessons.com (c)2007 SEMM(NL) All rights reserved Author:P.Hamaker For educational purposes only.-->
<html><head>
<script type="text/javascript">
function show( obj )
{
 var ta = document.getElementById('ta1') ;
 ta.value = '' ;
 for ( member in obj )
 {
  var s = member.toString();
  if ( s.charAt(0) == document.getElementById('tx1').value.charAt(0) )
    ta.value +=  s + ' : ' + obj[member] + '\n'  ;
 }
}
String.prototype.startsWithVowel =
function ()
{
  var ch = this.toString().charAt(0).toLowerCase() ;
  return ( ch == 'a' || ch == 'e' || ch == 'i'
         || ch == 'o' || ch == 'u' ) ;
}
String.prototype.devowelize =
function ()
{
  return this.toString().replace( /[aeiou]/gi , '' )  ;
}
function show2(  )
{
 var ta = document.getElementById('ta1') ;
 ta.value = '' ;
 var str = new String( document.getElementById('tx1').value );
 document.getElementById('tx1').style.backgroundColor
    = str.startsWithVowel() ? 'yellow' : '#ffdddd' ;
 ta.value = str.startsWithVowel() ;
}
function novow()
{
 var tx = document.getElementById('tx1') ;
 tx.value = tx.value.devowelize() ;
}
</script>
</head>
<body style="font-family: sans-serif; font-size: large; margin-left: 20; margin-top: 30">
<table><tr valign="top"><td>
JavaScript Lesson Objects<p>
<form>
<input id="tx1" type="text" maxlength="7" size="9" onclick="this.select()" value="a">
<input id="bt1" type="button" value="document" onclick="show(document)">
<input id="bt2" type="button" value="window" onclick="show(window)">
<input id="bt3" type="button" value="navigator" onclick="show(navigator)">
<input id="bt4" type="button" value="this button" onclick="show(this)"><br>
<input id="bt5" type="button" value="Starts with vowel ?" onclick="show2()">
<input id="bt6" type="button" value="Strip vowels" onclick="novow()">
</td><td>
<textarea id="ta1" rows="7" cols="35" readonly="readonly"></textarea>
 </td></tr></table>
</form>
<p><a href="http://javalessons.com" target="_top"><tt>JavaLessons.com</tt></a>
</body></html>