I have the following code where I try and replace '/' with '' in an input element. But its not working. The '/' is not being replaced.
How can I make it work?
var playlistTitle = document.getElementById('PlaylistTitleInput').value;
$('#PlaylistTitleInput').text($('#PlaylistTitleInput').text().replace("/", ''));
console.log(document.getElementById('PlaylistTitleInput').value);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><div class="fullPageBackgroundForPlaylistAdding" id="fullPageBackgroundForPlaylistAdding" style="display: none;"><!-- style="display: none;" --><div class="addPlaylistElementsContainer"><h1 class="playlistLabel">Create new playlist</h1><div class="PlaylistTitleInput"><input id="PlaylistTitleInput" type="text" name="playlistTitle" placeholder="New Playlist" value=""></div><div class="cancel_CreateDiv"><button id="cancelBtnPress">Cancel</button><button id="createBtnPress">Create</button></div></div></div>