1. I want to add a statement or piece of code after running HTML. How can I do that ? 2. Can I hide Input tag or button tag ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

1. I want to add a statement or piece of code after running HTML. How can I do that ? 2. Can I hide Input tag or button tag ?

19th Sep 2021, 1:49 PM
Harsh
Harsh - avatar
12 Answers
+ 2
Abhay , Thax Abhay, for paying attention on my question and giving your precious time. Coming back to point. Actually, I am trying to make a simple chatbot in which if you will type anything in input then, the reply will come in p tag. But, I want that a there must be two tags, one for "What user will have to type" and other for "What chatbot will say. For this there should always be new cases in switch tag. For that, a new code must get injected automatically. How can I do that ?
19th Sep 2021, 1:59 PM
Harsh
Harsh - avatar
+ 2
ℋℜҜ yes , you will need to add submit button or any other way you want to do it ? How would you add code to js just by input without any way of submitting it ? Submission can be done in anyway (you decide that).
9th Oct 2021, 3:38 PM
Abhay
Abhay - avatar
+ 1
Abhay , nice then, see this code and read the comment. https://code.sololearn.com/WyoMNNQhuzKK/?ref=app
19th Sep 2021, 2:24 PM
Harsh
Harsh - avatar
0
I didn't understand your first question. Maybe you can give an example ! For the 2nd question you can use visibility property with hidden as value or display property with none as value.
19th Sep 2021, 1:52 PM
Abhay
Abhay - avatar
0
ℋℜҜ sorry but i still didn't understand what you are looking to do. But if you want to inject html after html is ran then you can use javascript for it .
19th Sep 2021, 2:08 PM
Abhay
Abhay - avatar
0
Abhay , you got that right, I want to add on lines of codes after html is ran. But in javascript I want to do that. You know that we use switch(variable) for many if cases so, I want to add on more if cases in the code( In javascript only ). How can I do that ?
19th Sep 2021, 2:11 PM
Harsh
Harsh - avatar
0
ℋℜҜ do you have any example of it ? I really can't understand what cases you are looking to include . And what will the variable value be ? Or you can just write an example of what chatbot will say and then what you will reply and then again what chatbot will say and how do you expect it to go and it will make more sense to me .
19th Sep 2021, 2:15 PM
Abhay
Abhay - avatar
19th Sep 2021, 6:14 PM
Abhay
Abhay - avatar
0
Abhay , yes it was right but I want to get the code inserted forever. Whenever I type that word again then the result will be same.
28th Sep 2021, 10:10 AM
Harsh
Harsh - avatar
0
ℋℜҜ you will need a submit button so the question and answer will remain same. So do you plan on using a submit button or anything else you have in mind ?
28th Sep 2021, 10:14 AM
Abhay
Abhay - avatar
0
Abhay , Can I insert code in js after running program like tgrough input ?
9th Oct 2021, 2:15 AM
Harsh
Harsh - avatar
0
Abhay Through oninput
12th Oct 2021, 10:39 AM
Harsh
Harsh - avatar