Search Results

Search found 1 results on 1 pages for 'junaidkaps'.

Page 1/1 | 1 

  • JavaScript onClick() Display

    - by junaidkaps
    I have an array consisting of several objects containing Strings. I am successfully able to display the array by using: <td><p onclick="theMiddle(this)">The Middle</td> As you see from the td tag this is part of a table. Issue is that the browser opens up a new page to display my text. I have been trying to display the array above my table in a p tag. //JavaScript var arrayTheMiddle = new Array (showName.theMiddle, beginingTime.theMiddle, network.abc, duration.thirty, rating.general, description.theMiddle, showImage.theMiddle); function theMiddle(obj){ for(i=0; i < arrayTheMiddle.length; i++) { document.write(arrayTheMiddle[i] + "<br>"); } } //HTML File <p>Would like the array/function displayed here while the user clicks within the table below (entire table has not been listed)</p> <td><p onclick="theMiddle(this)">The Middle</td> Unfortunately I am constantly failing at utilizing get element by id to call my function which consists of an array. I have searched for all sorts of stuff, yet frankly I'm lost. Not even sure if my approach is correct at this point. I'm sure this is one of those simple things that are blowing over my head!

    Read the article

1