mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:12:43 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			807 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			807 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <script src="./include.js"></script>
 | |
| <script>
 | |
|     test(() => {
 | |
|         let testCounter = 1;
 | |
|         function testPart(part) {
 | |
|             println(`${testCounter++}. ${JSON.stringify(part())}`);
 | |
|         }
 | |
| 
 | |
|         // 1. Get fieldset elements length
 | |
|         testPart(() => {
 | |
|             const fieldset = document.createElement('fieldset');
 | |
|             fieldset.innerHTML = `<input><input><button></button>`;
 | |
|             return fieldset.elements.length;
 | |
|         });
 | |
| 
 | |
|         // 2. Get fieldset elements set stuff
 | |
|         testPart(() => {
 | |
|             const fieldset = document.createElement('fieldset');
 | |
|             fieldset.innerHTML = `<input><input value="FAIL"><button></button>`;
 | |
|             fieldset.elements[0].value = 'PASS';
 | |
|             return fieldset.children[0].value;
 | |
|         });
 | |
|     });
 | |
| </script>
 | 
