Display input text and sub-input field | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Display input text and sub-input field

I want to fill a list of input that apear only if i click a + button and let the input text show in another div but only showing the input fields that are checked. I tried with angular js but i do not know how to make it more automatic. Till now i only knoe how to do this creating a new function for each input field. Someone knows how i can use an if statement or something to do this?

25th Jul 2020, 1:48 AM
CDC
CDC - avatar
3 Answers
+ 1
Using jquery checked checkbox value will be shown in div tag. $('#checkboxes input:checked').each(function() { $("div").text($(this).val()); }); It'll automatically show the checked checkbox. Hope it'll helpful to you. Thanks!
29th Jul 2020, 4:33 AM
Shaili Shah
Shaili Shah - avatar
+ 1
Thank you. I'll give this a try for sure.
29th Jul 2020, 4:35 AM
CDC
CDC - avatar
0
Welcome.
29th Jul 2020, 4:36 AM
Shaili Shah
Shaili Shah - avatar