in Education by
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago. Improve this question I have a div which contains a few buttons (for log in). After user is logged in using Facebook and redirected back to the page, I would like to keep this same div in there, but replace all its content with a new content. (remove buttons and say hi). Since I am new I wonder what would be a good practice : Create another div inside the first, set it to be hidden then when needed hide the first and show the other Create another div outside, and do the same as 1. a better way ? Doing 1 or 2 - I don't want the hidden div to take space when its hidden. How would you hide/show a div using Javascript ? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
It's not necessary to create another div You can change the content with innerHTML or innerText, if there is only text into the new content use innerText. Like : document.getElementById('div').innerText = "Logged"; document.getElementById('div2').innerHTML = "Bar
Foo";
Login
Login
Run code snippetExpand snippet

Related questions

0 votes
    Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 6, 2022 in Education by JackTerrance
0 votes
    i have a website that contain an iframe. www.vendeposto.com.br and i want to hide an element Im trying to do this ... the vendeposto.com.br site is this: Postos de gasolina a venda...
asked May 1, 2022 in Education by JackTerrance
0 votes
    i have a website that contain an iframe. www.vendeposto.com.br and i want to hide an element Im trying to do this ... the vendeposto.com.br site is this: Postos de gasolina a venda...
asked Apr 29, 2022 in Education by JackTerrance
0 votes
    i have a website that contain an iframe. www.vendeposto.com.br and i want to hide an element Im trying to do this ... the vendeposto.com.br site is this: Postos de gasolina a venda...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    This is part of the component : import MyComp from '../../lib/MyComp' const Data = ( { data } ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 26, 2022 in Education by JackTerrance
0 votes
    This is part of the component : import MyComp from '../../lib/MyComp' const Data = ( { data } ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    Course Results (${courseResponseList.getCourses().size()}) Want to show above div. jquery script. jQuery. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 6, 2022 in Education by JackTerrance
0 votes
    Course Results (${courseResponseList.getCourses().size()}) Want to show above div. jquery script. jQuery. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    Basically I've managed to layout my DIV elements into a circle shape but I've not managed to work ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    Basically I've managed to layout my DIV elements into a circle shape but I've not managed to work ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    Basically I've managed to layout my DIV elements into a circle shape but I've not managed to work ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I've noticed that the chart object has a fontSize property, but just changing it does nothing, even with ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I have an HTML table with a search field to filter the result by Name. And another field to show ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 22, 2022 in Education by JackTerrance
0 votes
    I write a lot of dynamically generated content (developing under PHP) and I use jQuery to add extra ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    .__________ infrastructure replaces a server completely when there is a change. Immutable Hybrid Mutable Semi-immutable...
asked Sep 15, 2021 in Technology by JackTerrance
...