JSFiddle - React, Tailwind, and code Playground
HTML
<div class="d_class">
<h1>TITLE</h1>
<p>
содержимое<br>
</p>
</div>
JavaScript
function Dobj(d_class) {
this.cont = $(d_class)
this.dTitle = this.cont.find("h1")
this.dBody = this.cont.find("p")
this.move = function() {
$(this.dBody).hide()
}
$(this.dTitle).click(this.move)
}
$( document ).ready(function() {
var d = new Dobj(".d_class")
console.log("hi")
});