Example 3

package okoko
import kotlin.browser.document
import kotlin.browser.window
external fun jQuery(selector: Any?): Unit

fun log() {
    println("log from Kotlin for JavaScript!")

fun jtext(selector:Any,txt:Any) {

fun boombayah() {
        jQuery("p").asDynamic().click( { jtext("p","Thank You, Sir!") })
        jtext("p","If you click on me, You will be mesmerized.")

fun main(args: Array<String>) {
    println("Welcome to Kotlin for JavaScript!")
<!doctype html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cloud.ibinti.com/file/ko4js/ko4js.core.js"></script>

<p>If you click on me, You will be blessed.</p>