Can not set "for" attribute for label element.
Original Reporter info from Mantis: yus
-
Reporter name: Yuri Serebrennikov
Original Reporter info from Mantis: yus
- Reporter name: Yuri Serebrennikov
Description:
i try create radio button element, but cannot set attribute 'for' for label element.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio
small example below
Steps to reproduce:
program project1;
{$mode objfpc}
uses
JS, Classes, SysUtils, Web;
var
fMain: TJSHTMLElement;
fElement: TJSHTMLElement;
fInput: TJSHTMLInputElement;
fLabel: TJSHTMLLabelElement;
begin
fMain := TJSHTMLElement(document.firstElementChild);
fElement := TJSHTMLElement(document.createElement('div'));
fInput := TJSHTMLInputElement(document.createElement('input'));
fLabel := TJSHTMLLabelElement(document.createElement('label'));
fInput._type:= 'radio';
finput.id := 'rb1';
flabel.textContent:='Radio Button';
flabel.For_:= 'rb1'; // < -- not set 'for' attribute :(
fElement.append(fInput);
fElement.append(fLabel);
fMain.appendChild(fElement);
end.
Mantis conversion info:
- Mantis ID: 38862
- Build: trunk r1180
- Fixed in revision: 1181