nested if

created html and js