If statement looking for a Class name in HTML

Discussion in 'JavaScript' started by Luis Grolez, Jul 6, 2008.

  1. #1
    Hi,
    I would like to make my IF STATEMENT to look for a Class name in the HTML called "breadcrumb" instead of looking for the Title Name of the page.

    This is the code a was up to:

    <script type="text/javascript">
    if (document.title == "Rugs"){
    document.getElementById('content').className='template-list';
    } else {
    document.getElementById('content').className='template-details';
    }
    </script>

    Thanks.
     
    Luis Grolez, Jul 6, 2008 IP
  2. gezzle

    gezzle Peon

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    gezzle, Jul 6, 2008 IP
  3. Luis Grolez

    Luis Grolez Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, I'm good now.
     
    Luis Grolez, Jul 6, 2008 IP