javascript - How do I open a jQuery dialog and auto-set its title to the attribute in the HTML tag? -


मेरे पास एक div है, जिस पर मैं title विशेषता सेट कर रहा हूं: < प्री> & lt; div id = "test" title = "टेस्ट डायलॉग" & gt; कुछ परीक्षण & lt; / div & gt;

तब मैं इसके साथ एक संवाद खोलता हूं:

  $ ('# test')। संवाद ({title: $ (this) .attr (' शीर्षक ')});   

पहली बार यह संवाद खुलता है, शीर्षक सफलतापूर्वक सेट हो जाता है हालांकि, अगर मैं संवाद बंद कर देता हूं और उसे पुनः खोलता हूं, तो शीर्षक रिक्त होगा। इसका कारण यह है, पहली बार jQuery ने संवाद खोल दिया है, यह तत्व की प्रतिलिपि बनाता है और title टैग को हटा देता है

Itemprop = "text">

मैं इसे open ईवेंट में ऐसा करना चाहता हूं:

  $ ("# test") .संवाद ({ खुला: समारोह (घटना, यूआई) {$ (यह) .dialog ("विकल्प", "शीर्षक", $ (यह) .attr ('title'));}});    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -