I'm making a page in JSP and am unable to determine how to do the following.
I have a bunch of radio buttons generated dynamically in a for loop
<%
for (Something something : somethings) {
for (Random random : something.getRandoms ()) { %>
<input type ="radio" name="<%= something%>" value="<%= random.toString()%>"><%= random%> <br>
<% }%>
Some text here : <input type = "text" name="<%= something%>Text" placeholder="Some more text here"/>
<% }%>
What I want to do is:
When one of the radio buttons are checked, the text box should be made empty and when some text is entered in the text box, the radio buttons should be cleared.
I tried in javascript by saying <name of text box>.value=""
, but it doesn't work.