55
rated 0 times
[
59]
[
4]
/ answers: 1 / hits: 55640
/ 14 Years ago, fri, june 25, 2010, 12:00:00
$(#addSelect).click(function() {
$(#optionsForm).after(Hello world.);
} );
This works.
$(#addSelect).click(function() {
$(#optionsForm).after(<tr>
<td><input type=text class=optionField value=Options /></td>
<td>
<ul class=option>
<li><select><option>Value..</option></select></li>
</ul>
</td>
</tr>);
} );
Something like this doesn't.
In Chrome, I get the error Unexpected token ILLEGAL. After Googling I've discovered my teeny brain doesn't know much about javascript and multi-lines. So I added '' to then end of each line. Yet, I now get the error Unexpected identifier.
I'd like this to not be as difficult as I'm making it :)
More From » jquery