goodk
asked on
ajax; dropdown menu - not using jquery or mvc
initially displayed:
<ul id="DevMenu">
<li id="cli">
<input type='button' id='Button1' value='asdf' onclick="showhide(this.val
</li>
</ul>
then I want to replace cli by input text,
function showhide(str) {
// alert(str);
document.getElementById("c
}
so the above works correctly and I see the text input displayed, now I want to display selected ul, and I do the following
document.getElementById("c
+ " <ul class='DevMenu first'> <li><a href='e' title='tr'>16 Mach</a></li> <li><a href='x' title='t2'>2 Lots </a></li> </ul> "
but the above part does not work,
basically I expected to see a dropdown, by the way if do the above in one string it works, so my string is correct. What I am asking is how do we dynamically manupulate innerstring using the Ajax. Behind the scene I am using ajax to replace the string.
please help how do we do three levels of string manupulations, 1- button, 2- text, 3- a dropdown.
Please do not refer me to an example, just guide me how to replace innerhtml???? thanks a lot.
I am basically trying to expand the following, example to a dropdown.
http://www.w3schools.com/ajax/ajax_aspphp.asp
ASKER
thanks, but my logic was correct, just had an error that you cannot replace ul in innerhtml?? did not need a div card; got it to work; thanks
ASKER
I've requested that this question be deleted for the following reason:
did resolved it
did resolved it
The question was answered!
ASKER
you can try it; but div card will not work inside ul and for the tri-level interaction
What was your solution?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the following solution worked.
and replace innerHTML of div.
<ul id="DevMenu">
<li id="cli">
<div id="button_or_text">
<input type='button' id='Button1' value='asdf' onclick="showhide(this.val
</div>
</li>
</ul>
function showhide(str) {
// alert(str);
document.getElementById("b
}