ogolnie moj problem polega na tym ze chce zrobic by przy kliknieciu np napisu "czas protrombinowy (PT+INR)" pojawial sie div w divie np "pb3" z taka sama nazwa. problem zaczal sie po napisaniu kodu na tekst w nowopowstalym divie. znaczy myslalem ze do tego jest metoda text() ale za chiny nie wiem w jaki sposob uzyc. probowalem w ten sposob(uzylem w kodzie jquery):
Kod
$("#b1").click(function (){
var bad = getElementById("b1");
newBad($(this).text(), 'b1');
});
var bad = getElementById("b1");
newBad($(this).text(), 'b1');
});
Kod
function newBad(nazw, name) {
var my_div = document.createElement('div');
my_div.id = 'a' + name;
my_div.innerHTML = nazw;
document.body.appendChild(my_div);
}
var my_div = document.createElement('div');
my_div.id = 'a' + name;
my_div.innerHTML = nazw;
document.body.appendChild(my_div);
}