Javascript 如何将无线电输入与文本输入相结合
我正在尝试为表单中的“其他”字段构建一个组合的无线电/文本输入Javascript 如何将无线电输入与文本输入相结合,javascript,html,css,forms,radio-button,Javascript,Html,Css,Forms,Radio Button,我正在尝试为表单中的“其他”字段构建一个组合的无线电/文本输入 <input id="artist" type="radio" name="artist" value="Other"> <input id="other-artist" type="text" name="other_artist" placeholder="Other Artist"/> 我不知道如何在文本输入中单击并选择收音机。我尝试将文本输入包装到标签中,但没有成功。您可以添加一个onclick
<input id="artist" type="radio" name="artist" value="Other">
<input id="other-artist" type="text" name="other_artist" placeholder="Other Artist"/>
我不知道如何在文本输入中单击并选择收音机。我尝试将文本输入包装到标签中,但没有成功。您可以添加一个onclick事件来取消输入,然后像这样检查收音机
<input id="artist" type="radio" name="artist" value="Other">
<input id="other-artist" type="text" name="other_artist"placeholder="Other Artist"
onClick="selectRadio()" />
希望有此帮助。您可以添加一个onclick事件来取消输入并像这样检查收音机
<input id="artist" type="radio" name="artist" value="Other">
<input id="other-artist" type="text" name="other_artist"placeholder="Other Artist"
onClick="selectRadio()" />
希望对您有所帮助。您的要求不明确。您希望通过单击文本框来选中
收音机
。那么,如果稍后需要,您如何再次取消选中收音机
?您的要求不清楚。您希望通过单击文本框来选中收音机
。那么,如果稍后需要,您如何再次取消选中收音机
?