JSFiddle - React, Tailwind, and code Playground

HTML

<div>
    <div class="headline" onmouseover="func(true)" onmouseout="func(false)">Headline 1 <div id="button">Test</div></div>

CSS

.headline {
    background-color: grey;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
    padding: 5px;
    width: 70%;
    position: relative;
}

#button{
    display: none;
    position: absolute;
    top: 5px;
    right: 100%;
    margin-right: 10px;
}

JavaScript

function func(showPanel) {
	if(showPanel) {
		$("#button").show();
	}
	else {
		$("#button").hide();
	}
}