1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Does anyone know how to change this to change the 'class' instead of the 'href' of th

Discussion in 'Web Design & Development' started by emonster55, Jan 23, 2005.

Thread Status:
Not open for further replies.
  1. emonster55

    emonster55 Thread Starter

    Joined:
    Oct 27, 2004
    Messages:
    2
    Does anyone know how to change this to change the 'class' instead of the 'href' of the object?

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function redirectPage() {
    var url640x480 = "http://www.yoursite.com/640x480";
    var url800x600 = "http://www.yoursite.com/800x600";
    var url1024x768 = "http://www.yoursite.com/1024x768";
    if ((screen.width == 640) && (screen.height == 480))
    window.location.href= url640x480;
    else if ((screen.width == 800) && (screen.height == 600))
    window.location.href= url800x600;
    else if ((screen.width == 1024) && (screen.height == 768))
    window.location.href= url1024x768;
    else window.location.href= url640x480;
    }
    -->
    </script>

    <body>

    <form>
    <input type=button value="Enter!" onClick="redirectPage()">
    </form>

    </body>
    </html>
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Does anyone change
  1. Allan Murray
    Replies:
    17
    Views:
    916
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/322692

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice