JSFiddle - React, Tailwind, and code Playground
HTML
<script src=" Sass This version contains the source SCSS files. By choosing this version you have more control over which components to include. You will need a Sass compiler if you choose this option. CDN You can find all the versions of the CDN at cdnjs. <!-"></script>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/js/materialize.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/css/materialize.min.css">
<ul id="slide-out" class="side-nav">
<input type="text" id="title" name="title" value="my Title">
</ul>
<a href="#" data-activates="slide-out" class="button-collapse" data-title="Option one title">Option 1</a>
<a href="#" data-activates="slide-out" class="button-collapse" data-title="Option two title">Option 2</a>
JavaScript
$('.button-collapse').sideNav({
menuWidth: 200, // Default is 240
edge: 'right', // Choose the horizontal origin
//closeOnClick: true, // Closes side-nav on <a> clicks, useful for Angular/Meteor
//draggable: true // Choose whether you can drag to open on touch screens
}
);
$(document).on('click','.button-collapse', function() {
$('#title').val($(this).data('title'));
console.log('I have been clicked');
})