JSFiddle - React, Tailwind, and code Playground

by Cameron Bernhardt

HTML

<div id="test"></div>

JavaScript

function parent(){
this.parent_last_name="khan";
this.occupation="business";

}
parent.prototype.ask=function(){
alert("what do you do?");
}
function child(){
this.child_name="mohsin";
this.occupation="student";
}
child.prototype=new parent();
var lol=new child();
document.getElementById('test').innerHTML = (lol.child_name+" "+lol.parent_last_name);