문제

I am having problems to display only the first input checked.

DEMO

The problem there is that is a list created by a PHP, so I just have to add JS to call the function checked="true" on the first one, I can't modify them by HTML.

도움이 되었습니까?

해결책

Try this,

$('.nav-dropdown input[type=radio]:first').prop('checked', true);

DEMO

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top