1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <header>
- <h1>Change OK</h1>
- </header>
- <body>
- <script>
- html =
- {
- "tagName": "body",
- "children": [
- {
- "tagname": "div",
- "children": [
- {
- "tagName": "span",
- "children": [
- "Enter a data please:"
- ],
- },
- {
- "tagName": "br"
- },
- {
- "tagName": "input",
- "attrs": {
- "type": "text",
- "id": "name"
- }
- },
- {
- "tagName": "input",
- "attrs": {
- "type": "text",
- "id": "surname"
- }
- }
- ]
- },
- {
- "tagName": "div",
- "children": [
- {
- "tagName": "button",
- "attrs": {
- "id": "ok"
- },
- "children": [
- "OK"
- ]
- },
- {
- "tagName": "button",
- "attrs": {
- "id": "cancel"
- },
- "children": [
- "Cancel"
- ]
- }
- ]
- }
- ]
- };
- // html.children[1].children[0].attrs.test = prompt("enter attribute value");
- html.children[1].children[0].attrs[prompt("enter attribute name")] = prompt("enter attribute value");
- </script>
- </body>
|