JSFiddle - React, Tailwind, and code Playground

by Torwan

HTML

<div id="header" class="search">
    <span class="click">Click here</span>
    <span class="focus">Focus here</span>
    <input type="text" name="test" />
    <input type="text" name="test" />
    <input type="text" name="test" />
</div>
<p id="ggf">tu będzie click</p>
<p id="ggfh">tu będzie focus</p>
<hr />
<div id="header1" class="search">
    <span class="click">Click here</span>
    <input type="text" name="test" />
    <input type="text" name="test" />
    <input type="text" name="test" />
</div>

JavaScript

$('#header.search span.click').click(function(){
    $('#ggf').text('Click!');
});
$('#header.search span.focus').focus(function(){
  $('#ggfh').text('Focus!');
});

$('#header1.search span').click(function(){
    $('#header1.search input').focus();
});