JavaScript Passing Data to Bootstrap Modals passing data to bootstrap modal,passing data to bootstrap modal

The one-off way

If this is the only time you'll ever need to do a UI-binding behavior in your site/app, do something like this:

$('.header-link').click(function(e) {
   $('.modal-header h4').html($(e.target).html())
})

CodePen Demo

This will just take the text (actually the HTML) in the link itself and put that in the header.

Using a library

If you plan to do these sorts of cool tricks in more parts of your app, consider using a UI-binding library like Angular JS or Knockout. This way you can data-bind parts of your UI with events.

Answer:1

I started Android Studio in my newly updated OS X (Mavericks now). Now in Android Studio (also just updated btw) I get a message "error running git" Error:Abnormal build process termination: ...

I started Android Studio in my newly updated OS X (Mavericks now). Now in Android Studio (also just updated btw) I get a message "error running git" Error:Abnormal build process termination: ...

  1. error abnormal build process termination

I am using PHP to fill a textarea: <textarea text-input" id="Desc" rows="15" wrap="soft" name="Desc"><?php echo $Desc; ?></textarea> but the textarea is showing HTML tags in it, ...

I am using PHP to fill a textarea: <textarea text-input" id="Desc" rows="15" wrap="soft" name="Desc"><?php echo $Desc; ?></textarea> but the textarea is showing HTML tags in it, ...

  1. convert textarea html
  2. textarea convert html to text
  3. html convert input to textarea

i have a <div> like this. <div id="div" class="a b _c d _e f"></div> how can convert classes of <div> to a javaScript array? var cls = $('#div').attr('class'); cls = $(cls)....

i have a <div> like this. <div id="div" class="a b _c d _e f"></div> how can convert classes of <div> to a javaScript array? var cls = $('#div').attr('class'); cls = $(cls)....

THE SITUATION: I am using angular-redactor as editor for my app. Everything is working fine except just one thing. I need to fire a blur event to ask confirmation to the user in case he want to ...

THE SITUATION: I am using angular-redactor as editor for my app. Everything is working fine except just one thing. I need to fire a blur event to ask confirmation to the user in case he want to ...