Base href attribute

Definition and Usage

href Sets or returns the value of the href attribute of the base element.

Base href attribute Specify the base URL for all relative URLs on the page.

By default, the base URL is the location of the current document, but it can be overridden by this attribute.

See also:

HTML পরিচ্ছেদকৃতকারীকরণঃHTML <base> ট্যাগ

Example

Example 1

Return the base URL for all relative URLs on the page:

var x = document.getElementById("myBase").href;

Try it yourself

Example 2

Change the value of the base URL:

document.getElementById("myBase").href = "https://www.codew3c.com/html/";

Try it yourself

Syntax

Return href attribute:

baseObject.href

set href attribute:

baseObject.href = URL

প্রতিশব্দ মান

মান বর্ণনা
URL বেস URL-কে নির্ধারণ করুন

প্রযুক্তিগত বিবরণ

ফলাফল: শব্দমালা মান, যা পৃষ্ঠায় সকল সম্পর্কিত URL-এর বেস URL-কে বলে, প্রোটোকল (যেমন http://) সহ

ব্রাউজার সমর্থন

চ্রোম এজ ফায়ারফক্স স্যাফারি ওপেরা
চ্রোম এজ ফায়ারফক্স স্যাফারি ওপেরা
সমর্থন সমর্থন সমর্থন সমর্থন সমর্থন

সংশ্লিষ্ট পৃষ্ঠা

HTML পরিচ্ছেদকৃতকারীকরণঃHTML <base> href প্রতিশব্দ