79838610

Date: 2025-12-05 07:09:55
Score: 1.5
Natty:
Report link

You are very close! The issue is in the use of 'event.target.name' in your 'switch' statement. Currently, your input elements only have 'id' attributes, but **no 'name' attributes**, so 'event.target.name' returns 'undefined', and none of your switch cases match.

To fix it:

Add the 'name' attribute to each input to match your 'switch' cases:

'''html

<input type="number" onchange="trial(event)" id="celcius" name="celcius" placeholder="Celsius">

<input type="number" onchange="trial(event)" id="faren" name="faren" placeholder="Fahrenheit">

<input type="number" onchange="trial(event)" id="kelvin" name="kelvin" placeholder="Kelvin">

Once you do that, your switch(event.target.name) logic will work properly and the other fields will update automatically.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: ginika