I need help on the following.
The only way to solve this is be able to target the class. else what i am trying will not work. (I need to append some buttons behind the input field) The cms system generate the code开发者_如何学Python for the input class itself. (apparently added on load screen) somehow there is now way i can target this with jquery…? or i just miss some skill be able to do so?
my jquery code:
$(".theInput").append($addButtons);
when i change .theInput
with a other class, all working, but .theInput is just not WORKING.
NEED HELP
auto-generated by the cms system where i have totally no control to adjust it.
<td class="system">
<div class="cell">
<input onchange="some long code" class="theInput" type="text" value="1" /></div>
<div class="cell">
<input onchange="some long code" class="theInput" type="text" value="1" /></div>
<div class="cell">
<input onchange="some long code" class="theInput" type="text" value="1" /></div>
and so on.
</td>
I'm not exactly sure what you mean by "behind the inputs", but you can't really append something to an input. Append adds the element inside, and there is no inside for an input. If you want to add something after the input you could do:
$(".theInput").after($addButtons);
Have you wrapped the code in a
$(document).ready(function(){$(".theInput").append($addButtons);
});
You have to wait for the Dom to be loaded until you can target elements
精彩评论