0

How can I make an event in jQuery that adds a "like" button every time I click a "create" button?

Currently I have only a "create" button and every time I click it I want a "like" button to be added to the page.

7
  • 3
    ???? have just seen a similar question a while ago..have you reposted with another id? Commented Jul 24, 2012 at 20:19
  • 1
    What have you tried? Where's your code? Have you done any searches at all to try to figure this out, or are you just hoping the community will do all the work for you? Commented Jul 24, 2012 at 20:20
  • 1
    So you are asking how to create an element in response to user interaction (a mouse click)? This should be covered by any jQuery tutorial. A quick Google search revealed: Dynamically create elements with jQuery. Of course there is always jQuery's documentation, especially api.jquery.com/category/manipulation Commented Jul 24, 2012 at 20:20
  • 1
    I've downvoted you because your question: (1) is vague, (2) has already been asked here and (3) you neglected to show any of your code or show us you have done any research on the problem and finally (4) googling your question, verbatim, provides TONS of answers. Commented Jul 24, 2012 at 20:24
  • 5
    PS: For many people who post here, their first posts don't get good reception and get tons of downvotes. Don't be discouraged, but DO check out the FAQ for asking questions Commented Jul 24, 2012 at 20:25

1 Answer 1

2

jQuery has a .append() method. Use this to add any text or markup to an element in you HTML document. Use this to add the necessary markup to create a new button on your page.

http://api.jquery.com/append/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.