On click of "Show all" I want to show all elements, On click of link "1st half" , I want to show "abc" "def" and "ghi". ON click of 2nd link "2nd half", I want to show "jkl", "mno" and "pqr". Again on click of link "show all ", I want to show everything. "abc" , "def", "ghi", "jkl", "mno", "pqr".
There are some similar questions which I found and tried to implement that. But I am not able to display again the hidden element.
Here are the sample of code:
When I click "Show first half", in JS I am doing this:
document.getElementById("abc").style.display = 'visible';
document.getElementById("def").style.display = 'visible';
document.getElementById("ghi").style.display = 'visible';
document.getElementById("jkl").style.display = 'none';
document.getElementById("mno").style.display = 'none';
document.getElementById("pqr").style.display = 'none';
Again when I click "Show All", I am doing this:
document.getElementById("abc").style.display = 'visible';
document.getElementById("def").style.display = 'visible';
document.getElementById("ghi").style.display = 'visible';
document.getElementById("jkl").style.display = 'visible';
document.getElementById("mno").style.display = 'visible';
document.getElementById("pqr").style.display = 'visible';
But this is not able to display the hidden element again.
Please let me know if you need any further information.
Thanks.
ng-modelinstend of usingdocument.getElementById("def").style.display? There are some directives specifically providerd by angularjs to show and hide elements. - nextt1