JSFiddle - React, Tailwind, and code Playground

by Guruprasad Rao

HTML

<div class="lines">
    <input type="text"/><span>7-5</span>
    <input type="text"/><span>7-6</span>
    <input type="text"/><span>7-7</span>
    <input type="text"/><span>7-8</span>
    <input type="text"/><span>7-9</span>
</div>

JavaScript

$(document).ready(function(e){
    $("input").click(function(){
        var that=$(this);
        var person = prompt("Please enter your name:");
        if (person != null) {
           that.val(person);   
           $(this).css("background-color","green");
        } 
        
    });
});