1👍
✅
If how_to_apply
is name of your text field, then your JS needs to be updated to,
...
if(var_name == 'Online')
{
$("input[name=how_to_apply]").hide();
}
else if(var_name == 'Others'){
alert("Other");
$("input[name=how_to_apply]").show();
}
...
$("#how_to_apply")
tries to find element with that id.
Source:stackexchange.com