Can I add any element to another HTML file when I click current submit button?

I’m creating a blog website for myself to take notes about my experiences, etc. I prepared HTML and CSS files. When I click “share” button, text is being sent to MySQL database and it can be shown on the main page. But I want to add a new div element on main page by clicking “share” button. How can I do that?