inherit with javascript