I want to display a specific part of the page and want to change it with button clicks.
When i insert my javascript, everythin looks fine
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
var $ = jQuery
$(document).ready(function(){
$('[data-showme]').on('click', function(){
var showme = $(this).attr('data-showme')
$('.variant_picker').hide()
$('#' + showme).show()
})
})
</script>
But after i save the javascript will change to this:
<a href="https://code.jquery.com/jquery-3.6.0.min.js">https://code.jquery.com/jquery-3.6.0.min.js</a>
var $ = jQuery
$(document).ready(function(){
$('[data-showme]').on('click', function(){
var showme = $(this).attr('data-showme')
$('.varianta_picker').hide()
$('#' + showme).show()
})
})
I use wordpress with elementor pro and used the html block.
<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"/>
- Mehrdad Moradi