today I'm having a problem with javascript and some variables, I try to make clicking on a button fill in the text field
Example: when clicking on "Youtube" this in the text field insert the url of youtube.
<div class="jumbotron">
<h1 class="display-3"><?php echo $config['website-name']; ?></h1>
<p class="lead"><?php echo $lang["slogan"]; ?></p>
<div class="btn-group" role="group">
<a id="twitter" class="btn btn-info" href="#"><?php echo $lang["twitter_1"]; ?></a>
<a id="youtube" class="btn btn-danger" href="#"><?php echo $lang["youtube_1"]; ?></a>
<a id="facebook" class="btn btn-primary" href="#"><?php echo $lang["facebook_1"]; ?></a>
</div>
<br>
<br>
<div class="btn-group" role="group">
<a id="vikipedi" class="btn btn-secondary" href="#"><?php echo $lang["wikipedia"]; ?></a>
<a id="google" class="btn btn-success" href="#"><?php echo $lang["google_1"]; ?></a>
</div>
<p class="lead">
<form class="form-group" action="index.php" method="post">
<input id="url" name="url" type="url" class="form-control" autocomplete="on" placeholder="http://"
autofocus required/>
<br>
<input class="btn btn-primary btn-lg" type="submit" value="<?php echo $lang["go"]; ?>"/>
</form>
</div>
<div class="text-center">
<p style="font-size:11px">
<small><?php echo $lang["agree"]; ?> <a
href="<?php echo $config['website-url']; ?>/?tos"><?php echo $lang["tos_2"]; ?></a>
</small>
</p>
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-3.3.1.js"></script>
<script>
$('#twitter').click(function () {
$('#url').val('https://twitter.com');
});
$('#youtube').click(function () {
$('#url').val('https://youtube.com');
});
$('#facebook').click(function () {
$('#url').val('https://facebook.com');
});
$('#google').click(function () {
$('#url').val('https://google.com');
});
$('#vikipedi').click(function () {
$('#url').val('https://wikipedia.org');
});
</script>
Edit:
The following error appears:
but requested an insecure script 'code.jquery.com/jquery-3.3.1.js'; This request has been blocked; the content must be served over HTTPS.