Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
<script type="text/javascript">
  function myFunction(){
  
    <?php
    echo myFunction(ShowAttributesvisible);
    
    ?>
  }
</script>


What I have tried:

<!-- <script>
  function myFunction() { 

var x = document.getElementById("btn_1");
document.getElementById("btn_1").innerHTML += "Output!!<br>"
      //document.getElementById("btn_1").innerHTML = "Hello";
    // document.getElementById("btn_1").innerHTML = ShowAttributesvisible();
     //var x = document.getElementsByTagName()[].$ShowAttributes("ShowAttributesvisible");
    //return(ShowAttributesvisible);
    //document.getElementById("ShowAttributesvisible").style.display = "visible";
  }
</script> -->


//This are the codes that i tried.
Posted
Updated 27-Aug-19 8:29am
v2

1 solution

You seem to be in a bit over your head. For example:
var x = document.getElementById("btn_1");
document.getElementById("btn_1").innerHTML += "Output!!<br>"
What is the purpose of the first line? I mean that both literally (what is it supposed to be doing) and figuratively: why did you do it considering the next line?
var x = document.getElementById("btn_1");
xinnerHTML += "Output!!<br>"
makes use of your first line - but the second line, alone (as you originally had it) is enough since you only make use of this object once.

Now, as for hiding data, you'd be better off using 'visible' and 'hidden' styles. What you're trying to do is not hiding/unhiding but replacing. As to why it doesn't work? Well, without seeing your HTML I couldn't say.
 
Share this answer
 
Comments
JzAbad 28-Aug-19 2:03am    
Hi whats your email? so that i can talk to u. Because i need some help. hihi
W Balboos, GHB 28-Aug-19 6:42am    
My email? Not going to happen.
Use the forums -

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900