function calcTemp(event) {
    var fahrenheit, celsius, temp, value;
    fahrenheit = document.querySelector('.fahrenheit');
    celsius = document.querySelector('.celsius');
    temp = document.querySelector('.weather__temp');

    if (event.target.className === 'fahrenheit') {
        celsius.classList.toggle('active');
        fahrenheit.classList.toggle('active');

        value = parseFloat(temp.textContent);
        temp.textContent = (value * 9 / 5 + 32).toFixed(0);
    } else if (event.target.className === 'celsius') {
        celsius.classList.toggle('active');
        fahrenheit.classList.toggle('active');

        value = parseFloat(temp.textContent);
        temp.textContent = ((value - 32) * 5 / 9).toFixed(0);
    }
}
//Function which calculates give temperature to different units
Function which calculates give temperature to different units
Function which calculates give temperature to different units
function calcTemp(event) {
    var fahrenheit, celsius, temp, value;
    fahrenheit = document.querySelector('.fahrenheit');
    celsius = document.querySelector('.celsius');
    temp = document.querySelector('.weather__temp');
    if (event.target.className === 'fahrenheit') {
        celsius.classList.toggle('active');
        fahrenheit.classList.toggle('active');
        value = parseFloat(temp.textContent);
        temp.textContent = (value * 9 / 5 + 32).toFixed(0);
    } else if (event.target.className === 'celsius') {
        celsius.classList.toggle('active');
        fahrenheit.classList.toggle('active');
        value = parseFloat(temp.textContent);
        temp.textContent = ((value - 32) * 5 / 9).toFixed(0);
    }
}
function calcTemp ( event ) { var fahrenheit , celsius , temp , value ; fahrenheit = document . querySelector ( '.fahrenheit' ) ; celsius = document . querySelector ( '.celsius' ) ; temp = document . querySelector ( '.weather__temp' ) ; if ( event . target . className === 'fahrenheit' ) { celsius . classList . toggle ( 'active' ) ; fahrenheit . classList . toggle ( 'active' ) ; value = parseFloat ( temp . textContent ) ; temp . textContent = ( value * 9 / 5 + 32 ) . toFixed ( 0 ) ; } else if ( event . target . className === 'celsius' ) { celsius . classList . toggle ( 'active' ) ; fahrenheit . classList . toggle ( 'active' ) ; value = parseFloat ( temp . textContent ) ; temp . textContent = ( ( value - 32 ) * 5 / 9 ) . toFixed ( 0 ) ; } }
Function which calculates give temperature to different units
Function which calculates give temperature to different units