How can I simplify this two lines of JavaScript so that it's not repetitive

welcome to shbcf.ru