Change link by checking a radio button

2798 views javascript

I have to modify <meta property="og:url" content=""> <- when somenone checks 'yes' in a radio button, is there any way I could do it using JavaScript?

<div class="form-group">

  <h4 class="control-label" data-selector="h4">Would you support us?</h4>

  <label class="radio-inline"><input type="radio" name="Yes" value="Yes">Sim</label>
  <label class="radio-inline"><input type="radio" name="No" value="No ">Não</label>


I tried something using "getElementByID" but I'm not sure if it's possible because it's a meta tag

answered question

1 Answer


Not sure if you needed a vanilla javascript answer but in jquery you could probably do something like this $("meta[property='og\\:url']").attr("content", "your desired string"); to change the content dynamically

posted this

Have an answer?


Please login first before posting an answer.