File tree 3 files changed +3
-3
lines changed
static/projects/web/wordle
3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 58
58
const hasIterationProtocol = variable => variable !== null && Symbol . iterator in Object ( variable )
59
59
function h ( type , params , children ) {
60
60
const el = document . createElement ( type )
61
- for ( let [ k , v ] of Object . entries ( params ) ) { el [ k ] = v }
61
+ for ( let [ k , v ] of Object . entries ( params ) ) { el . setAttribute ( k , v ) }
62
62
if ( typeof ( children ) === "string" ) { el . appendChild ( document . createTextNode ( children ) ) }
63
63
else if ( hasIterationProtocol ( children ) ) { for ( let c of children ) { el . append ( c ) } }
64
64
else if ( children ) { el . appendChild ( children ) }
Original file line number Diff line number Diff line change 22
22
const hasIterationProtocol = variable => variable !== null && Symbol . iterator in Object ( variable )
23
23
function h ( type , params , children ) {
24
24
const el = document . createElement ( type )
25
- for ( let [ k , v ] of Object . entries ( params ) ) { el [ k ] = v }
25
+ for ( let [ k , v ] of Object . entries ( params ) ) { el . setAttribute ( k , v ) }
26
26
if ( typeof ( children ) === "string" ) { el . appendChild ( document . createTextNode ( children ) ) }
27
27
else if ( hasIterationProtocol ( children ) ) { for ( let c of children ) { el . append ( c ) } }
28
28
else if ( children ) { el . appendChild ( children ) }
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ <h1>Wordle</h1>
24
24
export const hasIterationProtocol = variable => variable !== null && Symbol . iterator in Object ( variable ) ;
25
25
function h ( type , params , children ) {
26
26
const el = document . createElement ( type )
27
- for ( let [ k , v ] of Object . entries ( params ) ) { el [ k ] = v }
27
+ for ( let [ k , v ] of Object . entries ( params ) ) { el . setAttribute ( k , v ) }
28
28
if ( typeof ( children ) === "string" ) { el . appendChild ( document . createTextNode ( children ) ) }
29
29
else if ( hasIterationProtocol ( children ) ) { for ( let c of children ) { el . append ( c ) } }
30
30
else if ( children ) { el . appendChild ( children ) }
You can’t perform that action at this time.
0 commit comments