Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Changing titles of multiple divs

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #42704
    jonnow
    Participant

    Hi,

    Wondering if anyone might be able to give me a hand with the following. I’ve got a couple of divs that I want to let editors in a CMS change the Title attribute of. To do this I have created an editable area and a piece of jQuery that will grab the text from within this area and set the attr to it, which works fine.

    I’m slightly stuck though on how to do this for multiple divs. Can I use ‘this’ somehow, or should I use a for loop?

    In short:
    Take the h2 id=grabThis and append it to the title of the tab div

    [http://codepen.io/jonnow/pen/GaEiy](http://codepen.io/jonnow/pen/GaEiy “Check out the CodePen”)

    Thanks a lot!

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.