Forums

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

Home Forums JavaScript How to insert a attribute name in HTML (jQuery)

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #41088
    jcoder
    Member

    Hi All,

    I need to be able to insert the data attribute name in HTML. I want to pull the data-name out from the example below and insert it in HTML. If there is a way to get rid of data-, that would be great too.

    EX:

  • Will Robinson
  • CodePen:

    [http://codepen.io/jbatzel1/pen/icDEm](http://codepen.io/jbatzel1/pen/icDEm “”)

#116052
tammelin
Member

How about something like this http://codepen.io/anon/pen/LCjqv ?

Update: here is another alternative more similar to the example in your codepen http://codepen.io/anon/pen/kzuvo

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