简体   繁体   中英

how to select radio button by text in UIWebView

I have a webpage that has a radio button(with text beside it).
The radio button can be select by the text in PC/Mac browser(IE, Chrome, Safari).
But it can't be select by text in the iPad's safari. It only can be select by the radio dot.

I want to embed it in iOS UIWebView which I think it's core is safari.

How to solve it that the it can be select by the radio's text in iPad?

yes it doesnt support "for" attribute. maybe you can handle with js

<label for="radio" onclick="document.getElementById('radio').setAttribute('checked', '');">TestTest</label>

OR Global jQuery

$('label[for]').click(function(){
  $('#'+$(this).attr('for')).attr('checked','checked');
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM