Привязка js
<script type="text/javascript" src="script/js.js"></script>
Button
<button onclick="showText(this)">Read More...</button>
JS
function showText (el) {
if(el.previousElementSibling.clientHeight == 80) {
el.previousElementSibling.style.height = "100%";
el.innerHTML = "ShowLess...";
} else {
el.previousElementSibling.style.height = "80px";
el.innerHTML = "Read More...";
}
Ошибка в консоле:
js.js:8 Uncaught SyntaxError: Unexpected end of input 3index.html:53 Uncaught ReferenceError: showText is not definedonclick @ index.html:53 9index.html:77 Uncaught ReferenceError: showText is not definedonclick @ index.html:77