1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- let body = {
- tagName: 'body',
- paired: true,
- children: [
- {
- tagName: 'div',
- paired: true,
- children: [
- {
- tagName: 'span',
- paired: true,
- content: 'Enter a data please:'
- },
- {
- tagName: 'br',
- paired: false,
- },
- {
- tagName: 'input',
- paired: false,
- attrs: {
- id: 'name',
- type: 'text'
- }
- },
- {
- tagName: 'input',
- paired: false,
- attrs: {
- id: 'surname',
- type: 'text'
- }
- }
- ]
- },
- {
- tagName: 'div',
- paired: true,
- children: [
- {
- tagName: 'button',
- paired: true,
- attrs: {
- id: 'ok'
- },
- content: 'OK'
- },
- {
- tagName: 'button',
- paired: true,
- attrs: {
- id: 'cancel'
- },
- content: 'Cancel'
- }
- ]
- }
- ]
- }
- alert(body.children[1].children[1].content);
- alert(body.children[0].children[3].attrs.id);
|