html - Checkbox and Radio buttons behaviour -


this question has answer here:

i using set of checkboxes have drop-down menus switching display:none; display:block when box or radio checked.

this checkbox version : https://jsfiddle.net/hw207q2l/

and radio version : https://jsfiddle.net/3xzuw47x/

i'd combine both when opening new part closes other ones (radio behaviour) ; while @ same time being able close part opened clicking again (checkbox behaviour).

any ideas wouldn't involve javascript ? i'd restrain using js, if it's not possible tell me.

it requires functionality prevents default behavior, it's unlikely make happen without using of additional framework or javascript.

this not duplicate, please check how uncheck checked radio button [duplicate].

just use javascript in second version of code:

var allradios = document.getelementsbyname('titles'); var booradio; var x = 0; for(x = 0; x < allradios.length; x++){     allradios[x].onclick = function() {         if(booradio == this){             this.checked = false;             booradio = null;         }else{             booradio = this;         }     }; } 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -