jquery insertafter() is not working in $(this) variable.
My coding is here
<select name="input_field[]" class="selectcase">
<option value="">Select</option>
<option value="input">Text</option>
<option value="option">Option</option>
</select>
Script
$(this).change(function (){
$("<div><input type='text' name=''></div>").insertAfter($(this));
});
I have many select tag and choose particular select tag. Using change function, I want to add textbox after select tag. I used insertAfter() function. But it is not working.
Dont use this as id in first line, must be replaced with select :
$('select').change(function (){
$("<div><input type='text' name=''></div>").insertAfter($(this));
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With