When I click on a specific link, it triggers an alert using jQuery.
Here is the HTML code for the link:
<a class="link" href="www.example.com">link</a>
The JavaScript code attached to the link is as follows:
$(".link").click(function() {
alert('clicked');
return false;
});
In the CSS code snippet below, a condition is set for when the user's screen width is at least 980px:
@media (min-width: 980px)
{
// When the link is clicked within this width range,
// I want it to open www.example.com
}
How can I determine whether the client's device width is less than or greater than 980 pixels?