I want to share some URL on Facebook, when user enter the link in the first text box and click "Generate Link" button, User can see his URL in "Text Area" field. I want to add Facebook share button for share "Text Area" URL, when user click "Share Now" button.here is my code. Could you please help me?
<p>Enter Your URL here</p>
<input type="url" id="url" placeholder="Paste your link">
<button type="button" ONCLICK="compute(this.form)">Generate Link</button>
<p>Show your link</p>
<textarea rows="5" id="title" readonly="readonly"></textarea>
<button type="button" ONCLICK="myFunction()">Copy Link</button>
<button type="button" >Share Now!</button>
//Java Script Codes
function compute(form){
form.title.value=("https://www.youtube.com/channel/"+form.url.value+"?sub_confirmation=1");
}
function ClearForm(form){
form.title.value="";
}
function ClearData(form){
form.url.value="";
}
function myFunction() {
var copyText = document.getElementById("title");
copyText.select();
document.execCommand("copy");
alert("Copied YouTube Link: " + copyText.value);
}