Miles M.
Miles M.

Reputation: 4169

Why is my html not displayed with jQuery html()?

I'm fairly new to jQuery so please be indulgent.

I got a variable in javascript that contains some html:

when doing console.log(tableData);

I get :

<tr class="table_row event_6163><td>Tue 16th Feb 2016</td><td>DEMO Venue</td><td>V_Town</td><td>United Kingdom</td><td class=green>Tickets available</td></tr> 

Then I do $('#event_stats tbody').append(tableData);

but I don't have anything displayed. Why ? It works with some other html content. I got no error in my console

Upvotes: 1

Views: 74

Answers (1)

MentholBonbon
MentholBonbon

Reputation: 755

There seems to be a quotation mark missing here:

<tr class="table_row event_6163>

it should probably be:

<tr class="table_row event_6163">

Quotation marks on the class green are also missing.

I don't know if that's caused the unwanted behavior. Unfortunately I cannot test your code since the frame is missing.

Upvotes: 3

Related Questions