Forums

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

Home Forums JavaScript Adding Img Src with Js

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #161489
    Dext3r
    Participant

    Hello first off i’m very new to all this so i need some help I need to add an image icon infront of the text through js only

    So when the button is generated it would look like:

    http://codepen.io/anon/pen/abFBu

    Thanks in advance.

    #161520
    chrisburton
    Participant

    Why not use CSS?

    #161544
    Dext3r
    Participant

    If i can get it working that way that would be great, its because i have 5 buttons under btn btn-mini btn-block

    And need an Icon on each of them, they are generated through the js script what way could you suggest doing it.

    #161549
    chrisburton
    Participant

    Well, I would use IcoMoon to create an icon font. And then use :before selector in CSS to put the icons before the text.

    #161565
    chrisburton
    Participant
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.