---
title: "How to get a subdomain for url in javascript?"  
description: "How to get a subdomain for url in javascript?"  
author: "Steilla Mitchel"  
published: 2023-12-28  
updated: 2023-12-28  
canonical: https://www.mindstick.com/forum/160550/how-to-get-a-subdomain-for-url-in-javascript  
category: "javascript"  
tags: ["javascript", "url"]  
reading_time: 1 minute  

---

# How to get a subdomain for url in javascript?

How to get a subdomain using window.location?


---

Original Source: https://www.mindstick.com/forum/160550/how-to-get-a-subdomain-for-url-in-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
