Convert Php Function To Javascript W3schools Alert