How can I turn a into a link?

The below is only an example.

You have to check whether the user is logged in using php, and save it in a cookie and then make the calculation using jQuery.

Do not use id to check if the user is logged in, because it is not secured. If the user inspects, and removes the id, he will be able to write in the box without logging in.

To redirect the user, instead of using alert, use window.location.href=""

$(function() {
  $("#isNotLogged").click(function() {
    alert('Please login');

<script src=""></script>

<textarea id="isLogged" placeholder="Textarea for Logged in"></textarea>
<br />

<textarea id="isNotLogged" placeholder="Textarea for Not Logged in"></textarea>

Browse More Popular Posts

Leave a Comment