Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Replacing HTML lines using javascript

    Hi. I have the following line in my HTML file <table class="bz_buglist" cellspacing="0" cellpadding="4" width="100%">
    And I need to use javascript to change this line to <table id="main_table" class="bz_buglist" cellspacing="0" cellpadding="4" width="100%"> . I just need to add the ID part.

    How can I do this? Is there a method of replacing the line, or a way to "add attribute"? thanks!

    kev.

  • #2
    Regular Coder Taro's Avatar
    Join Date
    Oct 2011
    Location
    Geraldton, Ontario
    Posts
    155
    Thanks
    1
    Thanked 1 Time in 1 Post
    Hello,

    Can you provide a link to the webpage of where this code is located? This can be done through a trigger event, possibly having the code be included in the element function.
    Element ID

    Webs Support Helper

    Your friendly neighborhood Taroman.

  • #3
    New to the CF scene
    Join Date
    May 2012
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi Taro.

    Here is the webpage http://bugzilla.maptools.org/buglist...icksearch=test

    Note that this isn't my own website as I am not allowed to link my own companies bugzilla, but the idea is the exact same. I need to add id="main_table" to the tables on the page once the page is loaded. My js will run after the page is loaded and not from the web server (i'm using greasemonkey.)

    Thanks


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •