Monday 23 September 2013

Colour Changer BG in HTML


<!-- TWO STEPS TO INSTALL BACKGROUND COLOR CHANGER:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the last code into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function newbg(thecolor)
{
document.bgColor=thecolor;
}
//  End -->
</script>

</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->

<BODY>

<H1 align="center"> Mr Knight's Colour Changer</h1>
<div align="center">
<form>
  <input type="button" value="White" onclick="newbg('white');">
  <input type="button" value="Blue" onclick="newbg('blue');">
  <input type="button" value="Beige" onclick="newbg('Beige');">
  <input type="button" value="Yellow" onclick="newbg('yellow');">
  <input type="button" value="mintcream" onclick="newbg('mintcream');">
  <input type="button" value="orchid" onclick="newbg('orchid');">
  <input type="button" value="crimson" onclick="newbg('crimson');">
  <input type="button" value="blueviolet" onclick="newbg('blueviolet');">
  <input type="button" value="olive" onclick="newbg('olive');">
  <input type="button" value="orange" onclick="newbg('orange');">
  <input type="button" value="hotpink" onclick="newbg('hotpink');">
  <input type="button" value="tomato" onclick="newbg('tomato');">
  <input type="button" value="chocolate" onclick="newbg('chocolate');">
  <input type="button" value="moccasin" onclick="newbg('moccasin');">
  <input type="button" value="plum" onclick="newbg('plum');">
  <input type="button" value="darkgoldenrod" onclick="newbg('darkgoldenrod');">
  <input type="button" value="lavender" onclick="newbg('lavender');">
  <input type="button" value="silver" onclick="newbg('silver');">
  <input type="button" value="ghostwhite" onclick="newbg('ghostwhite');">
  <input type="button" value="tan" onclick="newbg('tan');">
  <input type="button" value="gold" onclick="newbg('gold');">
  <input type="button" value="limegreen" onclick="newbg('limegreen');">
  <input type="button" value="lawngreen" onclick="newbg('lawngreen');">
  <input type="button" value="aliceblue" onclick="newbg('aliceblue');">
  <input type="button" value="brown" onclick="newbg('brown');">
  <input type="button" value="oldlace" onclick="newbg('oldlace');">
  <input type="button" value="firebrick" onclick="newbg('firebrick');">
<input type="button" value="lightcyan" onclick="newbg('lightcyan');">
<input type="button" value="lightcoral" onclick="newbg('lightcoral');">
<input type="button" value="goldenrod" onclick="newbg('goldenrod');">
<input type="button" value="powderblue" onclick="newbg('powderblue');">
<input type="button" value="darkviolet" onclick="newbg('darkviolet');">
<input type="button" value="indianred" onclick="newbg('indianred');">
<input type="button" value="fushsia" onclick="newbg('fushsia');">
<input type="button" value="palegoldenrod" onclick="newbg('palegoldenrod');">
<input type="button" value="navy" onclick="newbg('navy');">
<input type="button" value="yellowgreen" onclick="newbg('yellowgreen');">
<input type="button" value="silver" onclick="newbg('silver');">
<input type="button" value="teal" onclick="newbg('teal');">
<input type="button" value="salmon" onclick="newbg('salmon');">
<input type="button" value="chocolate" onclick="newbg('chocolate');">
<input type="button" value="gainsboro" onclick="newbg('gainsboro');">
<input type="button" value="darkslategray" onclick="newbg('darkslategray');">
<input type="button" value="lemonchiffon" onclick="newbg('lemonchiffon');">
<input type="button" value="paleturquoise" onclick="newbg('paleturquoise');">




</form>
</div>


<p><center>
<font face="arial, helvetica" size"-2">Matthew D. Knight<br>
<a href="http://www.mrmknight.co.uk">www.Mrmknight.co.uk</a></font>
</center><p>

No comments:

Post a Comment

Wildern Pupils if you log onto your school email account you can leave a comment via that ID.