JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<input type="button" name="test" value="I'm a button" /><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
JavaScript
$(function() {
$("input[name='test']").click(function() {
var pos = $(this).offset(),
top = pos.top - $(document).scrollTop(); //minus amount scrolled down
$('<div></div>').html('test message')
.dialog({title: 'Test Dialog',
modal: false,
width: 200,
height:140,
position: [pos.left + $(this).outerWidth(), top],
resizable:false});
});
});