Jump to content
php.lv forumi

ie7 bugs


udens

Recommended Posts

Parādi kodiņu.

 

 

 

var newRadio=document.createElement('input');

newRadio.setAttribute('type','radio');

newRadio.setAttribute('style','padding-left:3px;');

newRadio.setAttribute('value',a);

newRadio.setAttribute('name','correct_'+id);

 

newLi.appendChild(newRadio);

 

 

nu es taisu aptauju kur ar js tu nospied + un sem jautaajuma pieevienojas inputi kur var savadiit atbildes un katram iputam galaa ir radio visiem radio ir vienaads name lai var noraadiit tikai vienu pareizu atbildi.

Edited by udens
Link to comment
Share on other sites

Uz IE elementi, kam grib pēc tam name nolasīt jātaisa citādāk

 

document.createElement('<input name="name">');

 

crossbrowseru skripts varētu būt šāds

function createNamedElement(type,name){
var element=null;
try{ element=document.createElement('<'+type+' name="'+name+'">'); }catch(e){ element=document.createElement(type); element.name=name; }
return element;
}

 

var el = createNamedElement('input','correct_'+id);

el.type = 'radio';

Edited by indoom
Link to comment
Share on other sites

×
×
  • Create New...