There is a piece of code that is shared between two websites, referred to as www.firstsite.com and www.secondsite.com
The goal is to conceal a specific div only when the user is on secondsite.
The access to the HTML is limited, but there is an option to add code before and after the targeted div. This includes inserting additional divs and JavaScript. jQuery is also available for use.
One approach could be as follows:
Code inserted before:
<script>
Implement some JavaScript that will alter the visibility of a div with the id 'hidesecondsite'
If the domain is www.secondsite.com, then change the visibility of the div with id = hidesecondsite to hidden
</script>
<div id=hidesecondsite> <!-- Opening a wrapper div since setting an id on the actual div is not feasible -->
Code inserted after:
</div> <!-- Closing the wrapper-->
Questions: Is this method achievable?
Since my understanding of JavaScript is minimal, would someone be able to demonstrate how it could be executed?
Thank you in advance