Is there please a simple way to make a radio button toggle - when a text near it is clicked - without introducing any big Javascript Framework into my smal PHP project?
You can also wrap your elements without giving them each an ID, since a <label>
is implicitly for the input it contains, like this:
<label>
<input type="radio" name="mode" value="create">
<i>create table</i>
</label>
You can use <label> elements, which are designed to do exactly that:
<input type="radio" id="radCreateMode" name="mode" value="create" />
<label for="radCreateMode"><i>create table</i></label>
Wrapping the input under the label should work.
<label>
<input type="radio" name="mode" value="create"><i>create table</i>
</label>
I had trouble finding the value of the radio button using this method, an alternative is to use a hit area increasing clickable area of a button.