how to get client mac address in javascript?

Today, We want to share with you how to get client mac address in javascript.In this post we will show you how to get client mac address in php, hear for Get Client MAC Address & IP Address using Javascript we will give you demo and example for implement.In this post, we will learn about Laravel 6 Get Ip Address with an example.

how do get client mac address using jquery?

Example 1:

<script type="text/javascript">
    var macAddress = "";
    var user_address_ip = "";
    var your_computernm = "";
    var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}");
    e = new Enumerator(wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True"));
    for(; !e.atEnd(); e.moveNext()) {
        var s = e.item();
        macAddress = s.MACAddress;
        user_address_ip = s.IPAddress(0);
        your_computernm = s.DNSHostName;

Example 2:

<input type="text" id="resultsMac" />
<input type="text" id="resultsIp" />
<input type="text" id="resultscname" />

<script type="text/javascript">
    document.getElementById("resultsMac").value = unescape(macAddress);
    document.getElementById("resultsIp").value = unescape(user_address_ip);
    document.getElementById("resultscname").value = unescape(your_computernm);

Example 3:


$full_address = exec('getmac'); 

$full_address = strtok($full_address, ' '); 

echo "YOUR MAC address of client is: $full_address"; 


echo "Yout Client's IP address is: $IP_ADDRESS"; 


I hope you get an idea about how to get visitors using JavaScript?.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Also Read This 👉   Laravel 6 Custom Date Validation Example