I am building a questionnaire in mostly javascript. Each question is added to the page with JS after the next button is clicked and on page load.
In IE if I view source it does not actual show the question that was added by JS. The question is added, and that part works fine.
Now, I am doing:
f.parent().parent().attr("class").split(" ")[1]
to get a class from a question. This works in IE8 and all other browsers but not IE9.
If I do:
f.parent().parent().hasClass("foo")
it returns false! But it does have the class, although I cannot see any of the html of the question added with JS, and I assume that IE does not see it!!
This both works in IE8...
IF i console.log a object it justs gives me a text : LOG: [object Object]. that does not help either, because you cant even click the object as in all other debuggers!!! IE....
EDIT:
After more testing:
You click a button to call this class() part. If I do: console.log($(f.parent().parent()).text()) it returns the buttons text! so the .parent().parent() does not actually work right
HTML
<tr class="matrix_row other>
<td>Other (specify)</td>
<td> </td>
<td>
<a class="add_more_matrix_input" href="#">Add one</a>
</td>
</tr>
Javascript:
$(".add_more_matrix_input").live("click", function() {
var f = $(this);
// console.log($(f.parent().parent()).text())
last_key = f.parent().parent().attr("class").split(" ")[1]
f, what are its parents, what classes are there etc?