Web function only works in host and not in clients

I have this code:

<tr id="hidden-row">	
				<td colspan=7>
					<a id="addrow" href="javascript:;" title="Add a row">Add a row</a>
					<button onclick="addarow()">Add a row</button>

and this script:

function addarow() {
	var table = document.getElementById("table-items");
	var row = table.insertRow(0);
	var cell1 = row.insertCell(0);
	var cell2 = row.insertCell(1);
	var cell3 = row.insertCell(2);
	var cell4 = row.insertCell(3);
	var cell5 = row.insertCell(4);
	var cell6 = row.insertCell(5);
	var cell7 = row.insertCell(6);
$(document).ready(function() {   
    $(".item-row:last").after('<tr class="item-row"><td>#</td><td>New Item</td><td>New</td><td>New</td><td>New</td><td>New</td><td>New</td></tr>');

When I test it in localhost, the button and link works fine but when I test it from a different PC, the link is not working and is the one I need to work. Any idea what can be the root cause? do I need extra permissions in my host or add an extra line of code? I am not very savvy with JS. Thank you in advance.

PHP, javascript, html, js

Can you elaborate on what you mean by “not working”? What are you expecting this code to do that it is not? Are you seeing any errors in the browser console? Is all this code in a single file? We really need to see the full code to better assist you.

Thank you!
I expect the code to add an extra row to my table, if I use the host PC the code works and it adds as many rows as I need but if I test it from a different PC (ip_address:port/project to host) it does not add the extra row and there is no error in console.
The script is in one file (script.js) and the php in a file(quote.php) I did not wanted to paste the entire php as it was large.