JSFiddle - React, Tailwind, and code Playground

by Alex Azuero

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>jQuery Set Form Fields Values</title>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("button").click(function(){
        var text = $(this).text();
        $('input[type="text"]').val(text);
    });
});
</script>
</head>
<body>
    <button type="button">Discovery</button>
    <button type="button">Atlantis</button>
    <button type="button">Endeavour</button>
    <p><strong>Note:</strong> Click the above buttons to set the value of following input box.</p>
    <p>
        <input type="text">
    </p>
</body>
</html>