Good morning! I have a problem and I can not resolve the issue. I need a buttom to appear or not according to the PHP condition. Making the buttom appear I'm getting, the point is that inside it has a javascript call that does not work inside PHP. I do not know what I'm doing wrong.
Here are the codes:
<header>
<script type="text/javascript">
function exibe(id) {
if(document.getElementById(id).style.display=="none") {
document.getElementById(id).style.display = "inline";
}
else {
document.getElementById(id).style.display = "none";
}
}
</script>
</header>
<body>
<?php
if (get('data_do_descredenciamento')!= ''){
echo '<button type="button" class="btn" href="#" onclick="javascript: exibe('conteudo');">SUBSTITUTO</button>';
}
?>
</body>
You're giving content error: onclick="javascript: exibe('conteudo')
Could someone help me, please?