mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-14 02:46:22 +02:00
Use Enumerated for the form{Enctype, Method} attributes
(cherry picked from commit ab04f6d422a0a328f2ded1e3d5bbcf614c95f07a)
24 lines
850 B
HTML
24 lines
850 B
HTML
<script src="./include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const btn = document.createElement('button');
|
|
const values = [
|
|
'', undefined, null,
|
|
'get', 'post', 'dialog',
|
|
'GeT', 'POST', 'DIAlog',
|
|
'foo', 'xpost', '5%'
|
|
];
|
|
|
|
println('button: unset');
|
|
println(`button.getAttribute('formMethod') == '${btn.getAttribute('formMethod')}'`);
|
|
println(`button.formMethod == '${btn.formMethod}'`);
|
|
for (value of values) {
|
|
btn.setAttribute('formMethod', value);
|
|
println('');
|
|
println(`button.setAttribute('formMethod', '${value}')`);
|
|
println(`button.getAttribute('formMethod') == '${btn.getAttribute('formMethod')}'`);
|
|
println(`button.formMethod == '${btn.formMethod}'`);
|
|
}
|
|
});
|
|
</script>
|